From ff5e321b1acc764edba5e493836d67c150235b32 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Sun, 5 Mar 2023 12:23:42 +0100 Subject: [PATCH] feat(k3s): Add label injection for nodes --- inventory/group_vars/all.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inventory/group_vars/all.yml b/inventory/group_vars/all.yml index 7db1449..96511eb 100644 --- a/inventory/group_vars/all.yml +++ b/inventory/group_vars/all.yml @@ -3,8 +3,8 @@ k3s_version: v1.23.16+k3s1 # ansible_user: debian systemd_dir: /etc/systemd/system master_ip: "{{ hostvars[groups['master'][0]]['wireguard_ip'] | default(groups['master'][0]) }}" -extra_server_args: "--no-deploy traefik --advertise-address {{hostvars[inventory_hostname]['wireguard_ip']}} --flannel-iface wg0 --tls-san {{ ansible_host }} --disable servicelb" -extra_agent_args: "--flannel-iface wg0 --node-external-ip {{hostvars[inventory_hostname]['ansible_default_ipv4']['address']}}" +extra_server_args: "--no-deploy traefik --advertise-address {{hostvars[inventory_hostname]['wireguard_ip']}} --flannel-iface wg0 --tls-san {{ ansible_host }} --disable servicelb {{ ['--node-label']|product(hostvars[inventory_hostname]['k3s_label'])|map('join', ' ')|join(' ') }}" +extra_agent_args: "--flannel-iface wg0 --node-external-ip {{hostvars[inventory_hostname]['ansible_default_ipv4']['address']}} {{ ['--node-label']|product(hostvars[inventory_hostname]['k3s_label'])|map('join', ' ')|join(' ') }}" cluster_vip: "10.20.0.2" patroni_cluster_name: "postgres-cluster"