Skip to content

Commit

Permalink
Welcome to my repositories DevOps blogs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nho Luong authored and Nho Luong committed Nov 8, 2024
0 parents commit 76c4e49
Show file tree
Hide file tree
Showing 101 changed files with 6,961 additions and 0 deletions.
51 changes: 51 additions & 0 deletions 1.2 DockerStackCommands.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version

#docker-compose.yml
version: '3.3'

services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress

wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
volumes:
db_data: {}


docker-compose up -d
docker container ls
docker-compose scale db=3
docker container ls
docker-compose down
docker container ls
cp docker-compose.yml stack.yml
docker stack --help
docker stack deploy -c stack.yml mystack
docker stack ls
docker stack services mystack
docker service ps mystack_db
docker service ps mystack_wordpress
docker network ls
docker stack ls
docker stack rm mystack
11 changes: 11 additions & 0 deletions Ansible/Ansible Assignments/Assignment_1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#---1 Create a Play book to install apache server on the destination server with yum module install only if the OS is 'Redhat' or 'CentOS' and version 7
# Hint:- ansible_distribution is the variable which can have possible values 'RedHat','CentOS','Ubuntu','Debian'
# ansible_distribution_version variable can have the value which can have the version of the linux


#--2. Create a play book to install apache server on RedHat and Ubuntu server
# Hint:- Create an Ubuntu machine and install python on it, apt module is used instead of yum in Ubuntu and name of software is apache2 not httpd

#--3 . Create a play book to create testuser1 and testuser2 on all the hosts (use loop)
Hint:- use "user" module

Loading

0 comments on commit 76c4e49

Please sign in to comment.