diff --git a/Section1/ansible.cfg b/Section1/ansible.cfg new file mode 100644 index 0000000000000000000000000000000000000000..4977601f59c0721bd05d4dd59cc3a3fd48f18da7 --- /dev/null +++ b/Section1/ansible.cfg @@ -0,0 +1,10 @@ +# My own config file, thank goodness! + +[defaults] + +host_key_checking = False +stdout_callback = yaml + +inventory = hosts + +nocows = True diff --git a/Section1/inventories/README.md b/Section1/inventories/README.md index 5cbfe3d44e3f1465e9e7c1bb38e72910f3866059..7ab527ef28470a938c370519e08b6dd287fe5f33 100644 --- a/Section1/inventories/README.md +++ b/Section1/inventories/README.md @@ -9,9 +9,51 @@ You can verify any of them as valid inventories with An example command line is... ``` -ansible-inventory --graph -i hosts.ini +$ ansible-inventory --graph -i hosts_with_variables.ini +@all: + |--@all_servers: + | |--@dbservers: + | | |--db1_dublin + | | |--db2_dublin + | |--@webservers: + | | |--web1_dublin + | | |--web2_dublin + |--@ungrouped: + | |--loadbalancer1 + | |--veos ``` ## Inventory variables -If you want to see the inventory variables too, you -will need to add ``--vars`` to the command line. +If you want to see the inventory variables too, you will need to add ``--vars`` to the command line. + +``` +$ ansible-inventory --graph -i hosts_with_variables.ini --vars +@all: + |--@all_servers: + | |--@dbservers: + | | |--db1_dublin + | | | |--{ansible_ssh_pass = swordfish} + | | | |--{ansible_user = zork} + | | |--db2_dublin + | | | |--{ansible_ssh_pass = swordfish} + | | | |--{ansible_user = zork} + | |--@webservers: + | | |--web1_dublin + | | | |--{ansible_ssh_pass = swordfish} + | | | |--{ansible_user = nginx_test} + | | |--web2_dublin + | | | |--{ansible_ssh_pass = swordfish} + | | | |--{ansible_user = nginx_test} + | | |--{ansible_user = nginx_test} + |--@ungrouped: + | |--loadbalancer1 + | | |--{ansible_ssh_pass = swordfish} + | | |--{ansible_user = zork} + | |--veos + | | |--{ansible_host = localhost} + | | |--{ansible_port = 9022} + | | |--{ansible_ssh_pass = swordfish} + | | |--{ansible_user = zork} + |--{ansible_ssh_pass = swordfish} + |--{ansible_user = zork} +```