Add more tests to see wtf is going wrong here..

This commit is contained in:
2025-08-07 21:34:20 -05:00
parent 18f49ceed8
commit ffe68073f7
3 changed files with 106 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
---
- name: Test Inventory with Collection Paths
hosts: localhost
gather_facts: false
tasks:
- name: Test inventory with explicit collection path
ansible.builtin.shell: |
export ANSIBLE_COLLECTIONS_PATH="/runner/requirements_collections:/usr/share/ansible/collections"
export LINODE_API_TOKEN="${LINODE_API_TOKEN}"
# Create temp inventory file
cat > /tmp/test_inventory.yml << 'EOF'
plugin: linode.cloud.inventory
access_token: "{{ lookup('env', 'LINODE_API_TOKEN') }}"
compose:
ansible_host: ipv4[0]
ansible_user: phlux
EOF
echo "=== Testing inventory ==="
ansible-inventory -i /tmp/test_inventory.yml --list
register: inventory_test
ignore_errors: true
environment:
ANSIBLE_COLLECTIONS_PATH: "/runner/requirements_collections:/usr/share/ansible/collections"
LINODE_API_TOKEN: "{{ lookup('env', 'LINODE_API_TOKEN') }}"
- name: Display inventory test results
ansible.builtin.debug:
msg: |
Return code: {{ inventory_test.rc }}
Stdout:
{{ inventory_test.stdout }}
Stderr:
{{ inventory_test.stderr }}