From 5a5d5de2a58a128629a7efffe056c157fa28acaa Mon Sep 17 00:00:00 2001 From: Sanh Doan Date: Fri, 28 May 2021 22:27:13 +0700 Subject: [PATCH] sanhdp - exercise 01 inventory yml --- ch2-inventory/inventory/sanhdp/02-nonFQDN.yml | 10 ++++++++ .../sanhdp/03-hostgroups-children copy.yml | 18 +++++++++++++ .../inventory/sanhdp/04-hostvars.yml | 25 +++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 ch2-inventory/inventory/sanhdp/02-nonFQDN.yml create mode 100644 ch2-inventory/inventory/sanhdp/03-hostgroups-children copy.yml create mode 100644 ch2-inventory/inventory/sanhdp/04-hostvars.yml diff --git a/ch2-inventory/inventory/sanhdp/02-nonFQDN.yml b/ch2-inventory/inventory/sanhdp/02-nonFQDN.yml new file mode 100644 index 0000000..da035b8 --- /dev/null +++ b/ch2-inventory/inventory/sanhdp/02-nonFQDN.yml @@ -0,0 +1,10 @@ +all: + hosts: + 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 diff --git a/ch2-inventory/inventory/sanhdp/03-hostgroups-children copy.yml b/ch2-inventory/inventory/sanhdp/03-hostgroups-children copy.yml new file mode 100644 index 0000000..5f89433 --- /dev/null +++ b/ch2-inventory/inventory/sanhdp/03-hostgroups-children copy.yml @@ -0,0 +1,18 @@ +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 + centos22: + ansible_host: 192.168.100.22 diff --git a/ch2-inventory/inventory/sanhdp/04-hostvars.yml b/ch2-inventory/inventory/sanhdp/04-hostvars.yml new file mode 100644 index 0000000..2718224 --- /dev/null +++ b/ch2-inventory/inventory/sanhdp/04-hostvars.yml @@ -0,0 +1,25 @@ +all: + hosts: + fakehost.local: + children: + linux: + children: + ubuntu: + hosts: + ubuntu11: + ansible_host: 192.168.100.11 + foo: bar + ubuntu12: + ansible_host: 192.168.100.12 + vars: + foo: bar2 + centos: + hosts: + centos21: + ansible_host: 192.168.100.21 + centos22: + ansible_host: 192.168.100.22 + vars: + foo: bar1 + vars: + foo: bar3