diff --git a/ch1-lab-setup/sample/hosts.ini b/ch1-lab-setup/sample/hosts.ini index 8a716fa..4a5278c 100644 --- a/ch1-lab-setup/sample/hosts.ini +++ b/ch1-lab-setup/sample/hosts.ini @@ -1,2 +1,7 @@ [linux] -192.168.100.21 +172.16.44.103 +172.16.44.231 +172.16.44.172 +#192.168.1.7 +#192.168.1.17 +#192.168.1.31 diff --git a/ch2-inventory/inventory/01-ipOnly.ini b/ch2-inventory/inventory/01-ipOnly.ini index c3b016c..1c9d018 100644 --- a/ch2-inventory/inventory/01-ipOnly.ini +++ b/ch2-inventory/inventory/01-ipOnly.ini @@ -1,5 +1,10 @@ +<<<<<<< HEAD +192.168.1.17 + +192.168.1.43 +======= 192.168.100.12 +>>>>>>> 19d7f43fd7619a5c19e29da439623a8e2c21b3df -192.168.100.21 +192.168.1.239 -192.168.100.22 diff --git a/ch2-inventory/student-nctin/02-nonFQDN.yml b/ch2-inventory/student-nctin/02-nonFQDN.yml new file mode 100644 index 0000000..a0a0ba2 --- /dev/null +++ b/ch2-inventory/student-nctin/02-nonFQDN.yml @@ -0,0 +1,12 @@ +all: + hosts: + ubuntu01: + ansible_host: 192.168.1.109 + centos01: + ansible_host: 192.168.1.17 + centos02: + ansible_host: 192.168.1.43 + centos03: + ansible_host: 192.168.1.239 + + diff --git a/ch2-inventory/student-nctin/03-hostgroups-children.yml b/ch2-inventory/student-nctin/03-hostgroups-children.yml new file mode 100644 index 0000000..a18be1f --- /dev/null +++ b/ch2-inventory/student-nctin/03-hostgroups-children.yml @@ -0,0 +1,19 @@ +all: + hosts: + fakehost.local: + children: + linux: + children: + ubuntu: + hosts: + ubuntu: + ansible_host: 192.168.1.109 + centos: + hosts: + centos1: + ansible_host: 192.168.1.17 + centos2: + ansible_host: 192.168.1.43 + centos3: + ansible_host: 192.168.1.239 + diff --git a/ch3-playbook/07-install-apache-not-work.yaml b/ch3-playbook/07-install-apache-not-work.yaml index 8a09eb2..a802f87 100644 --- a/ch3-playbook/07-install-apache-not-work.yaml +++ b/ch3-playbook/07-install-apache-not-work.yaml @@ -3,15 +3,25 @@ - name: The demo playbook hosts: all gather_facts: yes - + vars: + - my_name: tinnc + - web_server: + Debian: apache2 + RedHat: httpd tasks: - name: Install Apache package yum: - name: httpd + name: "{{ web_server[ansible_os_family] }}" state: latest + - name: index Hello! + template: + src: "files/index.html" + dest: "/var/www/html/" + mode: 0755 + - name: Restart and enable the service service: - name: httpd + name: "{{ web_server[ansible_os_family] }}" state: restarted - enabled: yes \ No newline at end of file + enabled: yes diff --git a/ch3-playbook/files/index.html b/ch3-playbook/files/index.html new file mode 100644 index 0000000..0fe9c3a --- /dev/null +++ b/ch3-playbook/files/index.html @@ -0,0 +1,8 @@ + +
+