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