Fix location of infra role and add linode inventory role
This commit is contained in:
@@ -3,4 +3,4 @@
|
|||||||
hosts: all
|
hosts: all
|
||||||
become: yes
|
become: yes
|
||||||
roles:
|
roles:
|
||||||
- debian_update
|
- infrastructure/debian_update
|
||||||
|
8
playbooks/inventory/linode_inventory.yml
Normal file
8
playbooks/inventory/linode_inventory.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- name: Gather Linode instances into dynamic inventory
|
||||||
|
hosts: localhost
|
||||||
|
gather_facts: false
|
||||||
|
tasks:
|
||||||
|
- name: Include Linode Inventory Role
|
||||||
|
import_role:
|
||||||
|
name: inventory/linode_inventory
|
7
roles/inventory/linode_inventory/tasks/main.yml
Normal file
7
roles/inventory/linode_inventory/tasks/main.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
- name: Load Linode instances into inventory
|
||||||
|
add_host:
|
||||||
|
name: "{{ item.label }}"
|
||||||
|
ansible_host: "{{ item.ipv4[] }}"
|
||||||
|
groups: linode_instances
|
||||||
|
loop: "{{ lookup('linode.cloud.linode', wantlist=True) }}"
|
Reference in New Issue
Block a user