From c6a0490af7398294961c71d491621453291e170d Mon Sep 17 00:00:00 2001 From: djpbessems Date: Wed, 20 Apr 2022 14:27:31 +0200 Subject: [PATCH] Initial setup 'kube-virt' --- playbook.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/playbook.yml b/playbook.yml index d46043b..d5408b4 100644 --- a/playbook.yml +++ b/playbook.yml @@ -116,6 +116,18 @@ ansible.builtin.set_fact: cluster: "{{ cluster | combine( { 'token': ( k3s_token.content | b64decode | trim ) } ) }}" + - name: Pull 'kube-vip' image + ansible.builtin.shell: + cmd: ctr image pull ghcr.io/kube-vip/kube-vip:latest + + - name: Generate manifest for daemonSet + ansible.builtin.shell: + cmd: "ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:latest vip /kube-vip manifest daemonset --interface {{ ansible_interfaces | difference(['lo']) }} --address {{ cluster.virtualip | ansible.utils.ipaddr('address') }} --inCluster --taint --controlplane --services --arp --leaderElection" + register: manifest + + - ansible.builtin.debug: + var: manifest + when: inventory_hostname == ansible_play_hosts[0] - name: Additional nodes