Add debugging to figure out why this isn't working

This commit is contained in:
2025-08-07 13:19:55 -05:00
parent e7d4e86794
commit aad72c2183
2 changed files with 49 additions and 22 deletions

View File

@@ -58,12 +58,18 @@
Groups created: {{ linode_inventory_data.keys() | reject('equalto', '_meta') | list | length }}
Inventory saved to: {{ temp_inventory_path }}
- name: Show raw script output for debugging
ansible.builtin.debug:
var: linode_inventory_result.stdout
when: linode_inventory_result.stdout | length > 0
- name: Show discovered hosts
ansible.builtin.debug:
msg: "Host: {{ item.key }} ({{ item.value.ansible_host }}) - Region: {{ item.value.linode_region }} - Status: {{ item.value.linode_status }}"
loop: "{{ linode_inventory_data._meta.hostvars | dict2items }}"
loop_control:
label: "{{ item.key }}"
when: linode_inventory_data._meta.hostvars | length > 0
- name: Create static inventory file (optional)
ansible.builtin.template:
@@ -73,15 +79,6 @@
when: inventory_format == "ini"
delegate_to: localhost
# AWX/Tower specific tasks
- name: Create inventory update script for AWX
ansible.builtin.template:
src: awx_inventory_update.sh.j2
dest: "{{ linode_inventory_output_dir }}/awx_inventory_update.sh"
mode: '0755'
delegate_to: localhost
when: awx_integration | default(false)
- name: Clean up temporary script
ansible.builtin.file:
path: "{{ linode_inventory_output_dir }}/linode_inventory.py"