diff --git a/ansible.cfg b/ansible.cfg index c3c1f59..e08f79c 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -4,4 +4,8 @@ [defaults] collections_path = ansible_collections/ -inventory = inventories \ No newline at end of file +inventory = inventories + +# For development only +# host_key_checking = False + diff --git a/inventories/fake/hosts.yml b/inventories/fake/hosts.yml new file mode 100644 index 0000000..8fddb28 --- /dev/null +++ b/inventories/fake/hosts.yml @@ -0,0 +1,22 @@ +env_fake: + vars: + ansible_host: localhost + ansible_connection: local + + hosts: + local: + + children: + web: + hosts: + fake-client1-web1: + #ansible_port: 2222 + fake-client1-web2: + vars: + ansible_user: root + db: + hosts: + fake-client1-db: + #vars: + # ansible_become: true + # ansible_become_pass: password diff --git a/inventories/lab/hosts.yml b/inventories/lab/hosts.yml index 9ceae84..f6ad9f4 100644 --- a/inventories/lab/hosts.yml +++ b/inventories/lab/hosts.yml @@ -1,22 +1,20 @@ -lab: - vars: - ansible_host: localhost - ansible_connection: local - +--- +env_lab: hosts: - local: - + rocky-1: + ansible_host: 192.168.122.129 + rocky-2: + ansible_host: 192.168.122.19 + vars: + ansible_user: cloud-user +all: children: web: - hosts: - client1-web1: - #ansible_port: 2222 - client1-web2: - vars: - ansible_user: root + hosts: + rocky-1: db: - hosts: - client1-db: - #vars: - # ansible_become: true - # ansible_become_pass: password + hosts: + rocky-2: + vars: + environment_name: lab + diff --git a/playbooks/hello.yml b/playbooks/hello.yml index 2de859a..9b44099 100644 --- a/playbooks/hello.yml +++ b/playbooks/hello.yml @@ -10,7 +10,7 @@ msg: Hello, world! - name: Hello World - hosts: client1-web1 + hosts: web gather_facts: no tasks: @@ -19,7 +19,7 @@ name: activia.infra_common.configure_web - name: Hello World - hosts: client1-db + hosts: db gather_facts: no tasks: @@ -35,4 +35,4 @@ - \ No newline at end of file +