mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2026-09-08 21:27:36 +02:00
build
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user