Files
ewnix-automation/playbooks/inventory/linode.yaml

27 lines
807 B
YAML

---
- name: Sync Linode Hosts to AWX Inventory
hosts: localhost
gather_facts: false
connection: local
roles:
- roles/inventory/linode
# Optional: Example of using the discovered hosts
- name: Test connectivity to discovered Linode hosts
hosts: linode_all
gather_facts: false
tasks:
- name: Test connectivity to Linode hosts
ansible.builtin.ping:
register: ping_result
ignore_errors: true
- name: Display connectivity results
ansible.builtin.debug:
msg: |
{{ inventory_hostname }}: {{ 'REACHABLE' if ping_result is succeeded else 'UNREACHABLE' }}
IP: {{ ansible_host }}
Tags: {{ linode_tags | join(', ') }}
Role: {{ 'Control Plane' if is_control_plane else 'Worker Node' if is_worker_node else 'Other' }}