summaryrefslogtreecommitdiff
path: root/ansible-practice/system/03-playbook-print-gateway.yml
diff options
context:
space:
mode:
authorboom2 <blizzack@blizzack.com>2023-12-08 14:12:33 -0500
committerboom2 <blizzack@blizzack.com>2023-12-08 14:12:33 -0500
commitd8a7729358a2fd3b911022e45d0197fda3e5da94 (patch)
treef75d69bcd7b08a9bebf325c037e4557c61a958e2 /ansible-practice/system/03-playbook-print-gateway.yml
parent2fd6a845dfe9ed6b3189c247928dc87d8f76d01a (diff)
- add exeriments for:
- roles - variables - inventory changes - config changes
Diffstat (limited to 'ansible-practice/system/03-playbook-print-gateway.yml')
-rw-r--r--ansible-practice/system/03-playbook-print-gateway.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/ansible-practice/system/03-playbook-print-gateway.yml b/ansible-practice/system/03-playbook-print-gateway.yml
new file mode 100644
index 0000000..7fd2277
--- /dev/null
+++ b/ansible-practice/system/03-playbook-print-gateway.yml
@@ -0,0 +1,16 @@
+# display some per host info using 'magic variables'
+# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/debug_module.html
+# https://docs.ansible.com/ansible/latest/inventory/implicit_localhost.html
+# https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_delegation.html
+#
+
+---
+- name: "03 - display some per host info"
+ hosts: all
+# hosts: localhost
+# connection: local
+ tasks:
+ - name: Print the gateway for each host when defined
+ ansible.builtin.debug:
+ msg: System {{ inventory_hostname }} has gateway {{ ansible_default_ipv4.gateway }}
+ when: ansible_default_ipv4.gateway is defined \ No newline at end of file