Let's use linode.cloud.instance to populate..
This commit is contained in:
@@ -1,9 +1,6 @@
|
|||||||
---
|
---
|
||||||
plugin: linode.cloud.inventory
|
plugin: linode.cloud.instance
|
||||||
access_token: "{{ lookup('env', 'LINODE_API_TOKEN') }}"
|
api_token: "{{ lookup('env', 'LINODE_API_TOKEN') }}"
|
||||||
|
|
||||||
# Basic settings
|
|
||||||
strict: false
|
|
||||||
|
|
||||||
# Create groups by Linode attributes
|
# Create groups by Linode attributes
|
||||||
keyed_groups:
|
keyed_groups:
|
||||||
@@ -27,6 +24,14 @@ keyed_groups:
|
|||||||
prefix: tag
|
prefix: tag
|
||||||
separator: "_"
|
separator: "_"
|
||||||
|
|
||||||
|
# Create logical groups based on tags
|
||||||
|
groups:
|
||||||
|
k3s_cluster: "'k3s' in (tags|list)"
|
||||||
|
control_plane: "'control-plane' in (tags|list)"
|
||||||
|
worker_nodes: "'worker-node' in (tags|list)"
|
||||||
|
debian_hosts: "'Debian' in (tags|list)"
|
||||||
|
ubuntu_hosts: "'Ubuntu' in (tags|list)"
|
||||||
|
|
||||||
# Set host variables
|
# Set host variables
|
||||||
compose:
|
compose:
|
||||||
ansible_host: ipv4[0]
|
ansible_host: ipv4[0]
|
||||||
@@ -34,12 +39,8 @@ compose:
|
|||||||
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
|
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
|
||||||
|
|
||||||
# Add convenience booleans
|
# Add convenience booleans
|
||||||
is_k3s: "'k3s' in (tags | default([]))"
|
is_k3s: "'k3s' in (tags|list)"
|
||||||
is_control_plane: "'control-plane' in (tags | default([]))"
|
is_control_plane: "'control-plane' in (tags|list)"
|
||||||
is_worker_node: "'worker-node' in (tags | default([]))"
|
is_worker_node: "'worker-node' in (tags|list)"
|
||||||
is_debian: "'Debian' in (tags | default([]))"
|
is_debian: "'Debian' in (tags|list)"
|
||||||
is_ubuntu: "'Ubuntu' in (tags | default([]))"
|
is_ubuntu: "'Ubuntu' in (tags|list)"
|
||||||
|
|
||||||
# Only include running instances
|
|
||||||
filters:
|
|
||||||
- status == "running"
|
|
||||||
|
Reference in New Issue
Block a user