diff --git a/.ansible-lint b/.ansible-lint index de843ea..c533a6b 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,14 +1,14 @@ -# skip_list: -# - yaml[truthy] -# - yaml[colons] -# - no-changed-when -# - line-length -# - yaml[empty-lines] -# - name[template] -# - yaml[comments] -# - meta-incorrect -# - jinja[spacing] -# - yaml[line-length] - skip_list: - - "" + - yaml[truthy] + - yaml[colons] + - no-changed-when + - line-length + - yaml[empty-lines] + - name[template] + - yaml[comments] + - meta-incorrect + - jinja[spacing] + - yaml[line-length] + +# skip_list: +# - "" diff --git a/ansible.cfg b/ansible.cfg index 9baefdf..6627938 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,4 +1,5 @@ [defaults] +inventory = hosts gathering = smart gather_timeout = 300 fact_path = facts.d diff --git a/hosts b/hosts new file mode 100644 index 0000000..e98c6a6 --- /dev/null +++ b/hosts @@ -0,0 +1,104 @@ +# Lab Environment Inventory +################################################# +# +# Configuration : lab_hosts +# Template Version : 1.0-220908.1055 +# +# Chris Hammer +################################################# + + +######################### +# Environment Overview # +# -------------------- # +# KEY: # +# Node :: Group :: IP # +######################### +# lab-tower-1 :: aap_lab_nodes :: 10.10.42.225 :: zg-vm-dev3 +# lab-tower-2 :: aap_lab_nodes :: 10.10.42.228 :: zg-vm-dev +# lab-tower-db-1 :: aap_lab_db :: 10.10.42.230 :: zg-vm-dev2 +# lab-isolated-1 :: aap_lab_isoexec :: 10.10.42.245 :: zg-vm-dev +# lab-isolated-2 :: aap_lab_isoexec :: 10.10.42.224 :: zg-vm-dev2 +# lab-isolated-3 :: aap_lab_isoexec :: 10.10.42.136 :: zg-vm-dev3 +# lab-dev-1 :: unassigned :: 10.10.42.235 :: zg-vm-dev +# lab-dev-2 :: unassigned :: 10.10.42.203 :: zg-vm-dev2 +# lab-dev-3 :: unassigned :: 10.10.42.218 :: zg-vm-dev3 +# lab-dev-4 :: unassigned :: 10.10.42.183 :: zg-vm-dev +# lab-dev-5 :: unassigned :: 10.10.42.175 :: zg-vm-dev2 +# lab-hub-1 :: unassigned :: 10.10.42.132 :: zg-vm-dev2 + + + +################### +### HOST GROUPS ### +################### +[aap_lab_nodes] +lab-tower-1 ansible_host=10.10.42.225 +lab-tower-2 ansible_host=10.10.42.228 + +[aap_lab_isoexec] +lab-isolated-1 ansible_host=10.10.42.245 +lab-isolated-2 ansible_host=10.10.42.224 +lab-isolated-3 ansible_host=10.10.42.136 + +[aap_lab_dev] + +[aap_lab_test] + +[aap_lab_prod] + +[aap_lab_db] +lab-tower-db-1 ansible_host=10.10.42.230 + +[aap_lab_control_nodes] + +[aap_lab_dhcp] + +[grafana] + +[prometheus] + +[unassigned] +lab-dev-1 ansible_host=10.10.42.235 +lab-dev-2 ansible_host=10.10.42.203 +lab-dev-3 ansible_host=10.10.42.218 +lab-dev-4 ansible_host=10.10.42.183 +lab-dev-5 ansible_host=10.10.42.175 +lab-hub-1 ansible_host=10.10.42.132 + + + +################# +### SUBGROUPS ### +################# +[aap_lab__all__envs:children] +aap_lab_dev +aap_lab_test +aap_lab_prod +aap_lab_db +aap_lab_dhcp +unassigned + +[aap_lab__all__envs:vars] +ansible_user=root + +[aap_lab__all__nodes:children] +aap_lab_nodes +aap_lab_isoexec +aap_lab_dev +aap_lab_test +aap_lab_prod +aap_lab_db +aap_lab_control_nodes +aap_lab_dhcp +grafana +prometheus +unassigned + +[aap_lab__all__nodes:vars] +ansible_user=root + + + +# vars for all hosts/groups +[all:vars] diff --git a/includes/inc3.yml b/includes/inc3.yml index 3d2693f..7024701 100644 --- a/includes/inc3.yml +++ b/includes/inc3.yml @@ -1,7 +1,3 @@ - name: Inc3 ansible.builtin.debug: msg: inc3 - - -- name: Package Facts - Inc3 - ansible.builtin.package_facts: diff --git a/test_includes_loop.yml b/test_includes_loop.yml index c211273..405383a 100644 --- a/test_includes_loop.yml +++ b/test_includes_loop.yml @@ -1,6 +1,6 @@ - name: Test Includes Performance - hosts: localhost - connection: local + hosts: all + become: false gather_facts: false @@ -20,10 +20,6 @@ tasks: - - name: Debug upgrade - ansible.builtin.debug: - msg: "y0" - - name: Includes on loop ansible.builtin.include_tasks: "includes/{{ item }}.yml" loop: "{{ install_products }}" diff --git a/test_includes_no_loop.yml b/test_includes_no_loop.yml index e913496..f795cd8 100644 --- a/test_includes_no_loop.yml +++ b/test_includes_no_loop.yml @@ -1,6 +1,6 @@ - name: Test Includes Performance - hosts: localhost - connection: local + hosts: all + become: false gather_facts: false