This commit is contained in:
2026-05-27 12:19:40 +02:00
parent b7110f0fb7
commit 4d58c86836
+15 -2
View File
@@ -35,7 +35,7 @@
delay: 6
until: "'System clock synchronized: yes' in timedatectl_status.stdout"
changed_when: false
- name: Create apt proxy file
ansible.builtin.copy:
dest: /etc/apt/apt.conf.d/02proxy
@@ -285,10 +285,23 @@
cmd: kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml
environment:
KUBECONFIG: /etc/kubernetes/admin.conf
when: inventory_hostname.endswith("-vm01.home.lan")
when:
- inventory_hostname.endswith("-vm01.home.lan")
- net_driver == "flannel"
register: flannel_result
changed_when: "'created' in flannel_result.stdout or 'configured' in flannel_result.stdout"
- name: Install Calico
ansible.builtin.command:
cmd: kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.31.3/manifests/calico.yaml
environment:
KUBECONFIG: /etc/kubernetes/admin.conf
when:
- inventory_hostname.endswith("-vm01.home.lan")
- net_driver == "calico"
register: calico_result
changed_when: "'created' in calico_result.stdout or 'configured' in calico_result.stdout"
- name: Get join command
command: sudo kubeadm token create --print-join-command
register: join_command