Several changes here
This commit is contained in:
@@ -11,6 +11,15 @@
|
||||
awx_integration: true
|
||||
cleanup_temp_files: false
|
||||
|
||||
# Git integration settings
|
||||
push_to_git: true
|
||||
|
||||
# AWX API integration (optional - for automatic project sync)
|
||||
awx_api_integration: false # Set to true if you want automatic project refresh
|
||||
# awx_host: "https://your-awx-host"
|
||||
# awx_project_id: "8" # Your project ID in AWX
|
||||
# awx_token: "{{ lookup('env', 'AWX_TOKEN') }}" # Set via credential or env var
|
||||
|
||||
# Optional filters
|
||||
include_only_running: false
|
||||
specific_regions: [] # e.g., ['us-east', 'us-west']
|
||||
@@ -42,17 +51,24 @@
|
||||
msg: |
|
||||
Inventory update complete!
|
||||
|
||||
Next steps for AWX integration:
|
||||
1. Copy the inventory script to your SCM repository
|
||||
2. Create a custom inventory source in AWX
|
||||
3. Point it to the linode_inventory.py script
|
||||
4. Set up the Linode API credential
|
||||
✅ Inventory file created: /runner/project/inventory/linode_hosts.json
|
||||
✅ Changes committed to Git: {{ 'Yes' if git_commit_result.rc == 0 else 'Failed - check logs' }}
|
||||
✅ Repository: git@git.ewnix.net:phlux/ewnix-automation.git
|
||||
|
||||
Files created:
|
||||
- JSON inventory: {{ linode_inventory_output_dir }}/{{ linode_inventory_output_file }}
|
||||
{% if inventory_format == "ini" %}
|
||||
- INI inventory: {{ linode_inventory_output_dir }}/linode_static_inventory.ini
|
||||
{% endif %}
|
||||
Next steps:
|
||||
1. {% if not awx_api_integration %}Manually sync your AWX project to pull the latest inventory{% else %}Project sync triggered automatically{% endif %}
|
||||
2. Create a new inventory source in AWX:
|
||||
- Source: "Sourced from a Project"
|
||||
- Inventory File: "inventory/linode_hosts.json"
|
||||
- No credential needed (it's a static file)
|
||||
3. Sync the inventory source to import your Linode hosts
|
||||
|
||||
Your {{ linode_inventory_data._meta.hostvars | length }} Linode hosts will be available in groups:
|
||||
- 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_worker_node ({{ hostvars[groups['localhost'][0]]['linode_inventory_data']._meta.hostvars | selectattr('is_worker_node', 'equalto', true) | list | length }} worker nodes)
|
||||
- region_us_southeast (regional grouping)
|
||||
- type_* (by instance type)
|
||||
|
||||
# Optional: Run against discovered Linode hosts
|
||||
- name: Debug and use discovered Linode hosts
|
||||
|
Reference in New Issue
Block a user