Update playbook to reference proper variables

This commit is contained in:
2025-08-07 14:17:17 -05:00
parent a36d7e04e3
commit 4ad8da93cd

View File

@@ -51,24 +51,26 @@
msg: | msg: |
Inventory update complete! Inventory update complete!
✅ Inventory file created: /runner/project/inventory/linode_hosts.json ✅ Inventory file created: inventory/linode_hosts.json
✅ Changes committed to Git: {{ 'Yes' if git_commit_result.rc == 0 else 'Failed - check logs' }} ✅ Changes committed to Git: {{ 'Yes' if git_commit_result is defined and git_commit_result.rc == 0 else 'Check logs for details' }}
✅ Repository: git@git.ewnix.net:phlux/ewnix-automation.git ✅ Repository: git@git.ewnix.net:phlux/ewnix-automation.git
Next steps: Next steps:
1. {% if not awx_api_integration %}Manually sync your AWX project to pull the latest inventory{% else %}Project sync triggered automatically{% endif %} 1. {% if not (awx_api_integration | default(false)) %}Manually sync your AWX project to pull the latest inventory{% else %}Project sync triggered automatically{% endif %}
2. Create a new inventory source in AWX: 2. Create a new inventory source in AWX:
- Source: "Sourced from a Project" - Source: "Sourced from a Project"
- Inventory File: "inventory/linode_hosts.json" - Inventory File: "inventory/linode_hosts.json"
- No credential needed (it's a static file) - No credential needed (it's a static file)
3. Sync the inventory source to import your Linode hosts 3. Sync the inventory source to import your Linode hosts
Your {{ linode_inventory_data._meta.hostvars | length }} Linode hosts will be available in groups: Your Linode hosts will be available in groups:
- tag_k3s (k3s cluster nodes) - tag_k3s (k3s cluster nodes)
- tag_control_plane ({{ hostvars[groups['localhost'][0]]['linode_inventory_data']._meta.hostvars | selectattr('is_control_plane', 'equalto', true) | list | length }} control plane nodes) - tag_control_plane (control plane nodes)
- tag_worker_node ({{ hostvars[groups['localhost'][0]]['linode_inventory_data']._meta.hostvars | selectattr('is_worker_node', 'equalto', true) | list | length }} worker nodes) - tag_worker_node (worker nodes)
- region_us_southeast (regional grouping) - region_us_southeast (regional grouping)
- type_* (by instance type) - type_* (by instance type)
Check the role output above for the exact number of hosts discovered and their details.
# Optional: Run against discovered Linode hosts # Optional: Run against discovered Linode hosts
- name: Debug and use discovered Linode hosts - name: Debug and use discovered Linode hosts