64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
- name: Install kube-vip static pod
|
|
ansible.builtin.import_tasks: kube-vip.yaml
|
|
|
|
- name: Copy kubeadm config
|
|
ansible.builtin.template:
|
|
src: kubeadm-config.yaml.j2
|
|
dest: /tmp/kubeadm-config.yaml
|
|
mode: "0600"
|
|
|
|
- name: Initialise Kubernetes cluster
|
|
ansible.builtin.command: kubeadm init --config /tmp/kubeadm-config.yaml
|
|
args:
|
|
creates: /etc/kubernetes/admin.conf
|
|
run_once: true
|
|
|
|
|
|
- name: Copy Kubernetes Admin Configuration
|
|
ansible.builtin.include_tasks: copy-config.yaml
|
|
run_once: true
|
|
|
|
|
|
- name: Generate Join Command
|
|
ansible.builtin.command: kubeadm token create --print-join-command
|
|
register: kubernetes_control_plane_join_command
|
|
run_once: true
|
|
changed_when: true
|
|
|
|
|
|
- name: Get Certificate Key
|
|
ansible.builtin.shell: set -o pipefail && kubeadm init phase upload-certs --upload-certs | tail -n 1
|
|
register: kubernetes_control_plane_certificate_key
|
|
run_once: true
|
|
changed_when: true
|
|
|
|
|
|
- name: Join Additional Control Planes
|
|
ansible.builtin.command: >-
|
|
{{ kubernetes_control_plane_join_command.stdout }}
|
|
--control-plane
|
|
--certificate-key
|
|
{{ kubernetes_control_plane_certificate_key.stdout }}
|
|
args:
|
|
creates: /etc/kubernetes/admin.conf
|
|
|
|
|
|
- name: Copy Kubernetes Admin Configuration
|
|
ansible.builtin.include_tasks: copy-config.yaml
|
|
|
|
|
|
- name: Untaint control planes
|
|
ansible.builtin.import_tasks: untaint.yaml
|
|
|
|
|
|
- name: Install Tools
|
|
ansible.builtin.import_tasks: tools.yaml
|
|
|
|
|
|
- name: Install Cilium CNI
|
|
ansible.builtin.import_tasks: cilium.yaml
|
|
|
|
|
|
# - name: Install Longhorn CSI
|
|
# ansible.builtin.import_tasks: longhorn.yaml
|