Oops. Forgot to update the role

This commit is contained in:
2025-05-11 00:15:21 -05:00
parent 84121b3149
commit 9e07592c4d

View File

@@ -1,20 +1,11 @@
---
- name: Fetch Linode instances
linode.cloud.linode_instance_info:
api_token: "{{ linode_token }}"
register: linodes
- name: Get Linode inventory using local module
linode_inventory:
register: linode_result
- name: Build inventory lines
set_fact:
linode_inventory: |
{% for linode in linodes.data %}
{{ linode.label }} ansible_host={{ linode.ipv4[0] }} {% for tag in linode.tags %}group_{{ tag }}=true {% endfor %}
{% endfor %}
- name: Write dynamic inventory to file
- name: Write inventory to file
copy:
dest: /tmp/linode_inventory.ini
content: |
[all]
{{ linode_inventory }}
dest: /tmp/linode_inventory.json
content: "{{ linode_result | to_nice_json }}"
mode: '0644'