35 lines
775 B
YAML
35 lines
775 B
YAML
- name: Get Calico Definition
|
|
get_url:
|
|
url: https://docs.projectcalico.org/manifests/calico.yaml
|
|
dest: /tmp/calico.yml
|
|
delegate_to: k8s-master
|
|
run_once: true
|
|
|
|
- name: Copy kubeadm-crio.yaml to k8s-master
|
|
ansible.builtin.copy:
|
|
src: "files/{{ item }}"
|
|
dest: "/root/{{ item }}"
|
|
owner: root
|
|
group: root
|
|
mode: '0644'
|
|
loop:
|
|
- "kubeadm-crio.yaml"
|
|
- "kubeadm-config.yaml"
|
|
delegate_to: k8s-master
|
|
run_once: true
|
|
|
|
- name: Init Cluster
|
|
shell: >
|
|
kubeadm init --config=/root/kubeadm-config.yaml --upload-certs | tee kubeadm-init.out
|
|
register: kubeadm_init
|
|
delegate_to: k8s-master
|
|
run_once: true
|
|
|
|
- debug:
|
|
msg: "{{ kubeadm_init.stdout }}"
|
|
run_once: true
|
|
|
|
- name: enable Calico
|
|
shell: kubectl apply -f /tmp/calico.yaml
|
|
|