From fc078fb11cd8d72623c8cd6d63840df75ce802c8 Mon Sep 17 00:00:00 2001 From: Kevin Thompson Date: Thu, 7 Aug 2025 22:09:08 -0500 Subject: [PATCH] Let's use linode.cloud.instance to populate.. --- inventory/linode.yaml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/inventory/linode.yaml b/inventory/linode.yaml index e0a3b3c..394c14c 100644 --- a/inventory/linode.yaml +++ b/inventory/linode.yaml @@ -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)"