2024-04-27 01:33:23 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# BOOTSTRAP
|
|
|
|
- name: rke2 boostrap initial server node
|
|
|
|
ansible.builtin.shell: "{{ k8s_install_script }}"
|
2024-04-30 03:30:58 +00:00
|
|
|
environment: "{{ k8s_env }}"
|
2024-04-27 01:33:23 +00:00
|
|
|
when:
|
|
|
|
- k8s_node_type == "bootstrap"
|
|
|
|
|
2024-05-05 17:02:27 +00:00
|
|
|
- name: rke2 template cni manifest override
|
2024-04-27 01:33:23 +00:00
|
|
|
ansible.builtin.template:
|
2024-05-13 19:45:20 +00:00
|
|
|
src: "templates/{{ k8s_type }}/{{ k8s_cni_type | d('canal') }}-config.yaml.j2"
|
2024-04-30 03:30:58 +00:00
|
|
|
dest: "{{ k8s_manifests_path }}/{{ k8s_type }}-{{ k8s_cni_type | d('canal') }}-config.yaml"
|
2024-04-27 01:33:23 +00:00
|
|
|
mode: 0600
|
|
|
|
when:
|
2024-05-05 17:02:27 +00:00
|
|
|
- k8s_cni_manifest_overrides is defined and k8s_cni_manifest_overrides
|
2024-04-27 01:33:23 +00:00
|
|
|
- k8s_node_type == "bootstrap"
|
|
|
|
|
|
|
|
- name: rke2 start bootstrap node
|
2024-05-13 19:45:20 +00:00
|
|
|
ansible.builtin.include_tasks: shared/start.yml
|
2024-04-27 01:33:23 +00:00
|
|
|
when:
|
|
|
|
- k8s_node_type == "bootstrap"
|
|
|
|
|
|
|
|
# ADD SERVERS
|
|
|
|
- name: rke2 add additional server nodes
|
|
|
|
ansible.builtin.shell: "{{ k8s_install_script }}"
|
2024-04-30 03:30:58 +00:00
|
|
|
environment: "{{ k8s_env }}"
|
2024-04-27 01:33:23 +00:00
|
|
|
when:
|
|
|
|
- k8s_node_type == "server"
|
|
|
|
|
|
|
|
# ADD AGENTS
|
|
|
|
- name: rke2 add agent nodes
|
|
|
|
ansible.builtin.shell: "{{ k8s_install_script }}"
|
2024-04-30 03:30:58 +00:00
|
|
|
environment: "{{ k8s_env }}"
|
2024-04-27 01:33:23 +00:00
|
|
|
when:
|
|
|
|
- k8s_node_type == "agent"
|
|
|
|
|
|
|
|
# POST-DEPLOY
|
|
|
|
- name: rke2 start additional nodes
|
2024-05-13 19:45:20 +00:00
|
|
|
ansible.builtin.include_tasks: shared/start.yml
|
2024-04-27 01:33:23 +00:00
|
|
|
when:
|
|
|
|
- k8s_node_type != "bootstrap"
|