37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
---
|
|
- name: Apply Tigera operator
|
|
ansible.builtin.command: >
|
|
k3s kubectl apply -f {{ calico_operator_url }}
|
|
register: calico_operator
|
|
changed_when: "'created' in calico_operator.stdout or 'configured' in calico_operator.stdout"
|
|
retries: 3
|
|
delay: 10
|
|
|
|
- name: Wait for Tigera operator to be ready
|
|
ansible.builtin.command: >
|
|
k3s kubectl -n tigera-operator wait deployment/tigera-operator
|
|
--for=condition=Available --timeout=120s
|
|
changed_when: false
|
|
retries: 6
|
|
delay: 10
|
|
|
|
- name: Template Calico Installation CR
|
|
ansible.builtin.template:
|
|
src: calico-installation.yaml.j2
|
|
dest: /tmp/calico-installation.yaml
|
|
mode: '0644'
|
|
|
|
- name: Apply Calico Installation CR
|
|
ansible.builtin.command: k3s kubectl apply -f /tmp/calico-installation.yaml
|
|
register: calico_install
|
|
changed_when: "'created' in calico_install.stdout or 'configured' in calico_install.stdout"
|
|
|
|
- name: Wait for Calico nodes to be ready
|
|
ansible.builtin.command: >
|
|
k3s kubectl -n {{ calico_namespace }} wait pod
|
|
-l k8s-app=calico-node
|
|
--for=condition=Ready --timeout=180s
|
|
changed_when: false
|
|
retries: 6
|
|
delay: 15
|