pull in gnunn's cluster-config repo

This commit is contained in:
2025-03-29 14:24:43 -05:00
parent 28fc82623a
commit 413b2a9b7c
77 changed files with 22 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
---
- name: Print host IP addresses
hosts: infra01
gather_facts: false
vars:
my_hosts: "{{ query('inventory_hostnames', 'all') }}"
tasks:
- name: Loop through all hosts
ansible.builtin.debug:
msg: "Host {{ item }} has IP address: {{ hostvars[my_hosts[my_idx]].ip_address | default('No IP address defined') }}"
when: hostvars[my_hosts[my_idx]].ip_address is defined
loop: "{{ my_hosts }}"
loop_control:
index_var: my_idx