Files
ewnix-automation/inventory/linode.yaml

47 lines
1.1 KiB
YAML

---
plugin: linode.cloud.instance
api_token: "{{ lookup('env', 'LINODE_API_TOKEN') }}"
# Create groups by Linode attributes
keyed_groups:
# Group by region: region_us_southeast
- key: region
prefix: region
separator: "_"
# Group by type: type_g6_standard_6
- key: type
prefix: type
separator: "_"
# Group by status: status_running
- key: status
prefix: status
separator: "_"
# Group by each tag: tag_k3s, tag_debian, etc.
- key: tags
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]
ansible_user: phlux
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
# Add convenience booleans
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)"