File tree Expand file tree Collapse file tree 5 files changed +17
-13
lines changed Expand file tree Collapse file tree 5 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ VAGRANTFILE_API_VERSION = "2"
5
5
6
6
Vagrant . configure ( VAGRANTFILE_API_VERSION ) do |config |
7
7
# General Vagrant VM configuration.
8
- config . vm . box = "geerlingguy/centos7 "
8
+ config . vm . box = "geerlingguy/centos8 "
9
9
config . ssh . insert_key = false
10
10
config . vm . synced_folder "." , "/vagrant" , disabled : true
11
11
config . vm . provider :virtualbox do |v |
Original file line number Diff line number Diff line change 4
4
set -e
5
5
6
6
# Configure Django on app server.
7
- ansible app -b -m yum -a " name=MySQL-python state=present"
8
- ansible app -b -m yum -a " name=python-setuptools state=present"
9
- ansible app -b -m easy_install -a " name=django<2 state=present"
7
+ ansible app -b -m yum -a " name=python3-pip state=present"
8
+ ansible app -b -m pip -a " name=django<4 state=present"
10
9
11
10
# Check Django version.
12
- ansible app -a " python -c 'import django; print django.get_version()' "
11
+ ansible app -a " python3 -m django --version "
13
12
14
13
# Other commands from the book.
15
- ansible app -b -a " service ntpd status"
14
+ # ansible app -b -a "systemctl status chronyd "
16
15
ansible app -b -m group -a " name=admin state=present"
17
16
ansible app -b -m user -a " name=johndoe group=admin createhome=yes"
18
17
ansible app -b -m user -a " name=johndoe state=absent remove=yes"
Original file line number Diff line number Diff line change 6
6
# Configure MySQL (MariaDB) server.
7
7
ansible db -b -m yum -a " name=mariadb-server state=present"
8
8
ansible db -b -m service -a " name=mariadb state=started enabled=yes"
9
- ansible db -b -a " iptables -F"
10
- ansible db -b -a " iptables -A INPUT -s 192.168.60.0/24 -p tcp -m tcp --dport 3306 -j ACCEPT"
9
+
10
+ # Configure firewalld.
11
+ ansible db -b -m yum -a " name=firewalld state=present"
12
+ ansible db -b -m service -a " name=firewalld state=started enabled=yes"
13
+ ansible db -b -m firewalld -a " zone=database state=present permanent=yes"
14
+ ansible db -b -m firewalld -a " source=192.168.60.0/24 zone=database state=enabled permanent=yes"
15
+ ansible db -b -m firewalld -a " port=3306/tcp zone=database state=enabled permanent=yes"
11
16
12
17
# Configure DB user for Django.
13
- ansible db -b -m yum -a " name=MySQL-python state=present"
18
+ ansible db -b -m yum -a " name=python3-PyMySQL state=present"
14
19
ansible db -b -m mysql_user -a " name=django host=% password=12345 priv=*.*:ALL state=present"
Original file line number Diff line number Diff line change @@ -10,5 +10,5 @@ ansible multi -b -m fetch -a "src=/etc/hosts dest=/tmp"
10
10
ansible multi -m file -a " dest=/tmp/test mode=644 state=directory"
11
11
ansible multi -m file -a " dest=/tmp/test state=absent"
12
12
ansible multi -b -B 3600 -P 0 -a " yum -y update"
13
- ansible multi -b -a " tail /var/log/messages"
14
- ansible multi -b -m shell -a " tail /var/log/messages | grep ansible-command | wc -l"
13
+ # ansible multi -b -a "tail /var/log/messages"
14
+ # ansible multi -b -m shell -a "tail /var/log/messages | grep ansible-command | wc -l"
Original file line number Diff line number Diff line change @@ -14,11 +14,11 @@ sudo pip3 install ansible
14
14
cd orchestration/scripts
15
15
16
16
# Test Django app installation.
17
- docker run -d --name app -p 80:80 --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro geerlingguy/docker-centos7 -ansible
17
+ docker run -d --name app -p 80:80 --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro geerlingguy/docker-centos8 -ansible
18
18
./django-app.sh
19
19
20
20
# Test Django db installation.
21
- docker run -d --name db -p 3360:3360 --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro geerlingguy/docker-centos7 -ansible
21
+ docker run -d --name db -p 3360:3360 --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro geerlingguy/docker-centos8 -ansible
22
22
./django-db.sh
23
23
24
24
# Other tests from the book.
You can’t perform that action at this time.
0 commit comments