From f94deb4f4c6068c838c85d32fa1acc6d6a4e2dd9 Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sat, 29 May 2021 16:40:30 +0000 Subject: [PATCH 01/19] Update test1.txt --- ch2-inventory/student-trungdc/test1.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 ch2-inventory/student-trungdc/test1.txt diff --git a/ch2-inventory/student-trungdc/test1.txt b/ch2-inventory/student-trungdc/test1.txt new file mode 100644 index 0000000..8173172 --- /dev/null +++ b/ch2-inventory/student-trungdc/test1.txt @@ -0,0 +1,2 @@ +ccccccc +test From ecf48b9857b80b47d625fc376c427bb5a2532bfb Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sun, 30 May 2021 04:38:55 +0000 Subject: [PATCH 02/19] Update 01-ipOnly.yml --- ch2-inventory/student-trungdc/01-ipOnly.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 ch2-inventory/student-trungdc/01-ipOnly.yml diff --git a/ch2-inventory/student-trungdc/01-ipOnly.yml b/ch2-inventory/student-trungdc/01-ipOnly.yml new file mode 100644 index 0000000..c3b016c --- /dev/null +++ b/ch2-inventory/student-trungdc/01-ipOnly.yml @@ -0,0 +1,5 @@ +192.168.100.12 + +192.168.100.21 + +192.168.100.22 From 2111f292f516d8c525911d2fc1802a049dd0ce3c Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sun, 30 May 2021 04:50:01 +0000 Subject: [PATCH 03/19] Update 2-nonFQDN.yml --- ch2-inventory/student-trungdc/02-nonFQDN.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ch2-inventory/student-trungdc/02-nonFQDN.yml diff --git a/ch2-inventory/student-trungdc/02-nonFQDN.yml b/ch2-inventory/student-trungdc/02-nonFQDN.yml new file mode 100644 index 0000000..4fe4f59 --- /dev/null +++ b/ch2-inventory/student-trungdc/02-nonFQDN.yml @@ -0,0 +1,7 @@ +ubuntu11 ansible_host=192.168.100.11 + +ubuntu12 ansible_host=192.168.100.12 + +centos21 ansible_host=192.168.100.21 + +centos22 ansible_host=192.168.100.22 From ed006a4d317334fec9be95695e773e505c2e2097 Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sun, 30 May 2021 05:07:11 +0000 Subject: [PATCH 04/19] Update 03-hostgroups-children.yml --- .../student-trungdc/03-hostgroups-children.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ch2-inventory/student-trungdc/03-hostgroups-children.yml diff --git a/ch2-inventory/student-trungdc/03-hostgroups-children.yml b/ch2-inventory/student-trungdc/03-hostgroups-children.yml new file mode 100644 index 0000000..3e8bfef --- /dev/null +++ b/ch2-inventory/student-trungdc/03-hostgroups-children.yml @@ -0,0 +1,15 @@ +fakehost.local + +[ubuntu] +ubuntu11 ansible_host=192.168.100.11 +ubuntu12 ansible_host=192.168.100.12 + +[centos] +centos21 ansible_host=192.168.100.21 +centos22 ansible_host=192.168.100.22 + + +[linux:children] +ubuntu +centos + From d5e6cbe34eda2a1be36e11d77c6c0c2bc4d7692a Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sun, 30 May 2021 05:08:14 +0000 Subject: [PATCH 05/19] 04-hostvars.yml --- ch2-inventory/student-trungdc/04-hostvars.yml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ch2-inventory/student-trungdc/04-hostvars.yml diff --git a/ch2-inventory/student-trungdc/04-hostvars.yml b/ch2-inventory/student-trungdc/04-hostvars.yml new file mode 100644 index 0000000..15f623f --- /dev/null +++ b/ch2-inventory/student-trungdc/04-hostvars.yml @@ -0,0 +1,24 @@ +fakehost.local + +[ubuntu] +ubuntu11 ansible_host=192.168.100.11 foo=bar +ubuntu12 ansible_host=192.168.100.12 + +[centos] +centos21 ansible_host=192.168.100.21 +centos22 ansible_host=192.168.100.22 + + +[linux:children] +ubuntu +centos + +[all:vars] +foo=bar3 + +[linux:vars] +foo=bar1 + +[ubuntu:vars] +foo=bar2 + From 0ac30c07db34005d2da15629e6d10387c3d78e53 Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sun, 30 May 2021 05:14:19 +0000 Subject: [PATCH 06/19] remove tes1.txt --- ch2-inventory/student-trungdc/test1.txt | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 ch2-inventory/student-trungdc/test1.txt diff --git a/ch2-inventory/student-trungdc/test1.txt b/ch2-inventory/student-trungdc/test1.txt deleted file mode 100644 index 8173172..0000000 --- a/ch2-inventory/student-trungdc/test1.txt +++ /dev/null @@ -1,2 +0,0 @@ -ccccccc -test From dad51692d9b46950a6806ba0938242743b89c720 Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sun, 30 May 2021 06:03:59 +0000 Subject: [PATCH 07/19] update 02-nonFQDN.yml --- ch2-inventory/student-trungdc/02-nonFQDN.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/ch2-inventory/student-trungdc/02-nonFQDN.yml b/ch2-inventory/student-trungdc/02-nonFQDN.yml index 4fe4f59..8293cb7 100644 --- a/ch2-inventory/student-trungdc/02-nonFQDN.yml +++ b/ch2-inventory/student-trungdc/02-nonFQDN.yml @@ -1,7 +1,10 @@ -ubuntu11 ansible_host=192.168.100.11 - -ubuntu12 ansible_host=192.168.100.12 - -centos21 ansible_host=192.168.100.21 - -centos22 ansible_host=192.168.100.22 +all: + host : + ubuntu11: + ansible_host=192.168.100.11: + ubuntu12 : + ansible_host=192.168.100.12: + centos21 : + ansible_host=192.168.100.21: + centos22 : + ansible_host=192.168.100.22: From 1efc0d2b1b8837fcd47fcf28960e0b659d772167 Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sun, 30 May 2021 06:37:39 +0000 Subject: [PATCH 08/19] update 02-nonFQDN.yml --- ch2-inventory/student-trungdc/02-nonFQDN.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ch2-inventory/student-trungdc/02-nonFQDN.yml b/ch2-inventory/student-trungdc/02-nonFQDN.yml index 8293cb7..394b4db 100644 --- a/ch2-inventory/student-trungdc/02-nonFQDN.yml +++ b/ch2-inventory/student-trungdc/02-nonFQDN.yml @@ -1,10 +1,10 @@ all: - host : - ubuntu11: - ansible_host=192.168.100.11: - ubuntu12 : - ansible_host=192.168.100.12: - centos21 : - ansible_host=192.168.100.21: - centos22 : - ansible_host=192.168.100.22: + host: + ubuntu11: + ansible_host=192.168.100.11: + ubuntu12: + ansible_host=192.168.100.12: + centos21: + ansible_host=192.168.100.21: + centos22: + ansible_host=192.168.100.22: From 5b81eb37e60506b80fa6dc44e687856061c68bfc Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sun, 30 May 2021 06:51:06 +0000 Subject: [PATCH 09/19] update 03-hostgroups-children.yml --- .../03-hostgroups-children.yml | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/ch2-inventory/student-trungdc/03-hostgroups-children.yml b/ch2-inventory/student-trungdc/03-hostgroups-children.yml index 3e8bfef..b827084 100644 --- a/ch2-inventory/student-trungdc/03-hostgroups-children.yml +++ b/ch2-inventory/student-trungdc/03-hostgroups-children.yml @@ -1,15 +1,10 @@ -fakehost.local - -[ubuntu] -ubuntu11 ansible_host=192.168.100.11 -ubuntu12 ansible_host=192.168.100.12 - -[centos] -centos21 ansible_host=192.168.100.21 -centos22 ansible_host=192.168.100.22 - - -[linux:children] -ubuntu -centos - +all: + host: + fakehost.local: + children: + ubuntu: + ubuntu11 ansible_host=192.168.100.11: + ubuntu12 ansible_host=192.168.100.12: + centos: + centos21 ansible_host=192.168.100.21: + centos22 ansible_host=192.168.100.22: From 4552d0809fb25e344ae47c043844296ccd58a17f Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sun, 30 May 2021 10:13:39 +0000 Subject: [PATCH 10/19] update 02-nonFQDN.yml --- ch2-inventory/student-trungdc/02-nonFQDN.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ch2-inventory/student-trungdc/02-nonFQDN.yml b/ch2-inventory/student-trungdc/02-nonFQDN.yml index 394b4db..afc18e1 100644 --- a/ch2-inventory/student-trungdc/02-nonFQDN.yml +++ b/ch2-inventory/student-trungdc/02-nonFQDN.yml @@ -1,10 +1,8 @@ -all: - host: - ubuntu11: - ansible_host=192.168.100.11: - ubuntu12: - ansible_host=192.168.100.12: - centos21: - ansible_host=192.168.100.21: - centos22: - ansible_host=192.168.100.22: +ubuntu11: + ansible_host:192.168.100.11 +ubuntu12: + ansible_host:192.168.100.12 +centos21: + ansible_host:192.168.100.21 +centos22: + ansible_host:192.168.100.22 From 673737a4631d730f6720dbf0c847c0f41eba8af5 Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sun, 30 May 2021 11:05:35 +0000 Subject: [PATCH 11/19] update 03-hostgroups-children.yml --- .../03-hostgroups-children.yml | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/ch2-inventory/student-trungdc/03-hostgroups-children.yml b/ch2-inventory/student-trungdc/03-hostgroups-children.yml index b827084..3c2263a 100644 --- a/ch2-inventory/student-trungdc/03-hostgroups-children.yml +++ b/ch2-inventory/student-trungdc/03-hostgroups-children.yml @@ -1,10 +1,18 @@ all: - host: + hosts: fakehost.local: children: - ubuntu: - ubuntu11 ansible_host=192.168.100.11: - ubuntu12 ansible_host=192.168.100.12: - centos: - centos21 ansible_host=192.168.100.21: - centos22 ansible_host=192.168.100.22: + linux: + children: + ubuntu: + hosts: + ubuntu11: + ansible_host:192.168.100.11 + ubuntu12: + ansible_host:192.168.100.12 + centos: + hosts: + centos21: + ansible_host:192.168.100.21 + centos22: + ansible_host:192.168.100.22 From 3eaed8bf2645748c9aac69e869d5006d8734a733 Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sun, 30 May 2021 15:00:21 +0000 Subject: [PATCH 12/19] 02-nonFQDN.yml --- ch2-inventory/student-trungdc/02-nonFQDN.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ch2-inventory/student-trungdc/02-nonFQDN.yml b/ch2-inventory/student-trungdc/02-nonFQDN.yml index afc18e1..10940d9 100644 --- a/ch2-inventory/student-trungdc/02-nonFQDN.yml +++ b/ch2-inventory/student-trungdc/02-nonFQDN.yml @@ -1,8 +1,12 @@ -ubuntu11: - ansible_host:192.168.100.11 -ubuntu12: - ansible_host:192.168.100.12 -centos21: - ansible_host:192.168.100.21 -centos22: - ansible_host:192.168.100.22 +all: + children: + ungrouped: + hosts: + centos21: + ansible_host: 192.168.100.21 + centos22: + ansible_host: 192.168.100.22 + ubuntu11: + ansible_host: 192.168.100.11 + ubuntu12: + ansible_host: 192.168.100.12 From 372bda29e980c4e61a38afaec9bb0dc340b6497c Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sun, 30 May 2021 15:00:48 +0000 Subject: [PATCH 13/19] 03-hostgroups-children.yml --- .../03-hostgroups-children.yml | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ch2-inventory/student-trungdc/03-hostgroups-children.yml b/ch2-inventory/student-trungdc/03-hostgroups-children.yml index 3c2263a..982052e 100644 --- a/ch2-inventory/student-trungdc/03-hostgroups-children.yml +++ b/ch2-inventory/student-trungdc/03-hostgroups-children.yml @@ -1,18 +1,19 @@ all: - hosts: - fakehost.local: children: linux: children: - ubuntu: - hosts: - ubuntu11: - ansible_host:192.168.100.11 - ubuntu12: - ansible_host:192.168.100.12 centos: hosts: centos21: - ansible_host:192.168.100.21 + ansible_host: 192.168.100.21 centos22: - ansible_host:192.168.100.22 + ansible_host: 192.168.100.22 + ubuntu: + hosts: + ubuntu11: + ansible_host: 192.168.100.11 + ubuntu12: + ansible_host: 192.168.100.12 + ungrouped: + hosts: + fakehost.local: {} From 0a25e109b6ce8d52ad16f722963681267ea6f4f2 Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sun, 30 May 2021 15:01:13 +0000 Subject: [PATCH 14/19] 04-hostvars.yml --- ch2-inventory/student-trungdc/04-hostvars.yml | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/ch2-inventory/student-trungdc/04-hostvars.yml b/ch2-inventory/student-trungdc/04-hostvars.yml index 15f623f..f122bc8 100644 --- a/ch2-inventory/student-trungdc/04-hostvars.yml +++ b/ch2-inventory/student-trungdc/04-hostvars.yml @@ -1,24 +1,24 @@ -fakehost.local - -[ubuntu] -ubuntu11 ansible_host=192.168.100.11 foo=bar -ubuntu12 ansible_host=192.168.100.12 - -[centos] -centos21 ansible_host=192.168.100.21 -centos22 ansible_host=192.168.100.22 - - -[linux:children] -ubuntu -centos - -[all:vars] -foo=bar3 - -[linux:vars] -foo=bar1 - -[ubuntu:vars] -foo=bar2 - +all: + children: + linux: + children: + centos: + hosts: + centos21: + ansible_host: 192.168.100.21 + foo: bar1 + centos22: + ansible_host: 192.168.100.22 + foo: bar1 + ubuntu: + hosts: + ubuntu11: + ansible_host: 192.168.100.11 + foo: bar + ubuntu12: + ansible_host: 192.168.100.12 + foo: bar2 + ungrouped: + hosts: + fakehost.local: + foo: bar3 From 38c1404b31dd246fbdbc51541fe3c7130fe19a09 Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Sun, 30 May 2021 15:15:11 +0000 Subject: [PATCH 15/19] RM 01-ipOnly.yml --- ch2-inventory/student-trungdc/01-ipOnly.yml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 ch2-inventory/student-trungdc/01-ipOnly.yml diff --git a/ch2-inventory/student-trungdc/01-ipOnly.yml b/ch2-inventory/student-trungdc/01-ipOnly.yml deleted file mode 100644 index c3b016c..0000000 --- a/ch2-inventory/student-trungdc/01-ipOnly.yml +++ /dev/null @@ -1,5 +0,0 @@ -192.168.100.12 - -192.168.100.21 - -192.168.100.22 From 2125a723e3108ee86078b7e95b37e2757d86128d Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Wed, 2 Jun 2021 21:39:22 +0700 Subject: [PATCH 16/19] update gitinore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 42b4424..5b14a42 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ **/.vagrant/ **/*.retry *-console.log +**/all.yaml From 7a2cde98597456fa6a606a0da6a11b8f08a2a3d1 Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Wed, 2 Jun 2021 22:58:27 +0700 Subject: [PATCH 17/19] update 07-install... --- ch3-playbook/07-install-apache-not-work.yaml | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 ch3-playbook/07-install-apache-not-work.yaml diff --git a/ch3-playbook/07-install-apache-not-work.yaml b/ch3-playbook/07-install-apache-not-work.yaml new file mode 100644 index 0000000..b1ea56b --- /dev/null +++ b/ch3-playbook/07-install-apache-not-work.yaml @@ -0,0 +1,33 @@ +# Playbook for automated apache installation +--- +- name: The demo playbook + hosts: all + gather_facts: yes + become: yes + + tasks: + - name: Install Apache package Centos + yum: + name: httpd + state: latest + when: ansible_os_family == 'RedHat' + + - name: Install Apache package Ubuntu + apt: + name: apache2 + state: latest + when: ansible_os_family == 'Debian' + + - name: Restart and enable on Centos + service: + name: httpd + state: restarted + enabled: yes + when: ansible_os_family == 'RedHat' + + - name: Restart and enable on Ubuntu + service: + name: apache2 + state: restarted + enabled: yes + when: ansible_os_family == 'Debian' \ No newline at end of file From 122df480486d0127103e31777a377908364a4ad2 Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Wed, 2 Jun 2021 23:02:40 +0700 Subject: [PATCH 18/19] update file 07-apache... --- .../07-install-apache-not-work.yaml | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 ch3-playbook/student-trungdc/07-install-apache-not-work.yaml diff --git a/ch3-playbook/student-trungdc/07-install-apache-not-work.yaml b/ch3-playbook/student-trungdc/07-install-apache-not-work.yaml new file mode 100644 index 0000000..b1ea56b --- /dev/null +++ b/ch3-playbook/student-trungdc/07-install-apache-not-work.yaml @@ -0,0 +1,33 @@ +# Playbook for automated apache installation +--- +- name: The demo playbook + hosts: all + gather_facts: yes + become: yes + + tasks: + - name: Install Apache package Centos + yum: + name: httpd + state: latest + when: ansible_os_family == 'RedHat' + + - name: Install Apache package Ubuntu + apt: + name: apache2 + state: latest + when: ansible_os_family == 'Debian' + + - name: Restart and enable on Centos + service: + name: httpd + state: restarted + enabled: yes + when: ansible_os_family == 'RedHat' + + - name: Restart and enable on Ubuntu + service: + name: apache2 + state: restarted + enabled: yes + when: ansible_os_family == 'Debian' \ No newline at end of file From 71d4f7043519ed7656dc5216270b8c698fd6324c Mon Sep 17 00:00:00 2001 From: trungdc83 Date: Wed, 2 Jun 2021 23:05:24 +0700 Subject: [PATCH 19/19] remove 07 --- ch3-playbook/07-install-apache-not-work.yaml | 33 -------------------- 1 file changed, 33 deletions(-) delete mode 100644 ch3-playbook/07-install-apache-not-work.yaml diff --git a/ch3-playbook/07-install-apache-not-work.yaml b/ch3-playbook/07-install-apache-not-work.yaml deleted file mode 100644 index b1ea56b..0000000 --- a/ch3-playbook/07-install-apache-not-work.yaml +++ /dev/null @@ -1,33 +0,0 @@ -# Playbook for automated apache installation ---- -- name: The demo playbook - hosts: all - gather_facts: yes - become: yes - - tasks: - - name: Install Apache package Centos - yum: - name: httpd - state: latest - when: ansible_os_family == 'RedHat' - - - name: Install Apache package Ubuntu - apt: - name: apache2 - state: latest - when: ansible_os_family == 'Debian' - - - name: Restart and enable on Centos - service: - name: httpd - state: restarted - enabled: yes - when: ansible_os_family == 'RedHat' - - - name: Restart and enable on Ubuntu - service: - name: apache2 - state: restarted - enabled: yes - when: ansible_os_family == 'Debian' \ No newline at end of file