2019-12-20 20:03:27 +01:00
|
|
|
---
|
|
|
|
|
2019-12-21 18:11:30 +01:00
|
|
|
- import_tasks: build/preconfigure-k3s.yml
|
|
|
|
|
2020-05-18 20:53:03 +02:00
|
|
|
- import_tasks: teardown/drain-and-remove-nodes.yml
|
|
|
|
|
2019-12-21 18:11:30 +01:00
|
|
|
- import_tasks: build/get-version.yml
|
2021-12-15 18:15:25 +01:00
|
|
|
when:
|
|
|
|
- k3s_release_version is not defined
|
|
|
|
or not k3s_release_version
|
|
|
|
or k3s_release_version is not regex('\\+k3s[1-9]$')
|
|
|
|
- not k3s_airgap
|
2019-12-21 18:11:30 +01:00
|
|
|
|
|
|
|
- import_tasks: validate/main.yml
|
2020-09-21 20:38:51 +02:00
|
|
|
when: not k3s_skip_validation
|
2019-12-21 18:11:30 +01:00
|
|
|
|
|
|
|
- import_tasks: build/get-systemd-context.yml
|
2019-12-20 20:03:27 +01:00
|
|
|
|
2020-10-22 20:26:15 +02:00
|
|
|
- name: Ensure docker installation tasks are run
|
|
|
|
block:
|
|
|
|
|
2021-12-20 22:14:23 +01:00
|
|
|
- include_tasks: build/docker/{{ k3s_os_family }}/install-prerequisites.yml
|
2020-10-22 20:26:15 +02:00
|
|
|
|
2020-12-21 20:14:52 +01:00
|
|
|
- import_tasks: build/docker/install.yml
|
2021-12-20 22:14:23 +01:00
|
|
|
when: k3s_os_distribution not in ['amazon', 'suse', 'opensuse-leap', 'archlinux']
|
2020-10-22 20:26:15 +02:00
|
|
|
|
2021-12-20 22:14:23 +01:00
|
|
|
- include_tasks: build/docker/{{ k3s_os_distribution }}/install.yml
|
|
|
|
when: k3s_os_distribution in ['amazon', 'suse', 'opensuse-leap', 'archlinux']
|
2020-10-22 20:26:15 +02:00
|
|
|
|
2021-02-16 16:46:01 +01:00
|
|
|
when:
|
|
|
|
- ('docker' in k3s_runtime_config and k3s_runtime_config.docker)
|
|
|
|
- ('rootless' not in k3s_runtime_config or not k3s_runtime_config.rootless)
|
2019-12-20 20:03:27 +01:00
|
|
|
|
2021-03-14 17:29:14 +01:00
|
|
|
- name: Flush Handlers
|
|
|
|
meta: flush_handlers
|
2020-11-29 21:10:42 +01:00
|
|
|
|
2019-12-20 20:03:27 +01:00
|
|
|
- import_tasks: build/download-k3s.yml
|
2021-12-14 23:16:19 +01:00
|
|
|
when:
|
|
|
|
- not k3s_airgap
|
|
|
|
|
|
|
|
- import_tasks: build/airgap-k3s.yml
|
|
|
|
when:
|
|
|
|
- k3s_airgap
|
2019-12-20 20:03:27 +01:00
|
|
|
|
2020-01-11 15:10:19 +01:00
|
|
|
- import_tasks: build/preconfigure-k3s-auto-deploying-manifests.yml
|
2021-02-16 16:46:01 +01:00
|
|
|
when:
|
2021-05-26 00:39:48 +02:00
|
|
|
- k3s_primary_control_node
|
2021-02-16 16:46:01 +01:00
|
|
|
- k3s_server_manifests_templates | length > 0
|
2020-01-11 15:10:19 +01:00
|
|
|
|
2021-05-27 00:07:22 +02:00
|
|
|
- import_tasks: build/preconfigure-k3s-auto-deploying-manifests-urls.yml
|
|
|
|
when:
|
|
|
|
- k3s_primary_control_node
|
|
|
|
- k3s_server_manifests_urls | length > 0
|
|
|
|
|
2021-05-26 09:52:34 +02:00
|
|
|
- import_tasks: build/preconfigure-k3s-static-pod-manifests.yml
|
2021-05-26 09:43:07 +02:00
|
|
|
when:
|
|
|
|
- k3s_control_node
|
2021-05-26 09:52:34 +02:00
|
|
|
- k3s_server_pod_manifests_templates | length > 0
|
2021-05-26 09:43:07 +02:00
|
|
|
|
2021-05-27 00:07:22 +02:00
|
|
|
- import_tasks: build/preconfigure-k3s-static-pod-manifests-urls.yml
|
|
|
|
when:
|
|
|
|
- k3s_control_node
|
|
|
|
- k3s_server_pod_manifests_urls | length > 0
|
|
|
|
|
2021-09-06 14:46:49 +02:00
|
|
|
- import_tasks: build/preconfigure-k3s-server-config-yaml-d.yml
|
|
|
|
when:
|
|
|
|
- k3s_control_node
|
|
|
|
- k3s_server_config_yaml_d_files | length > 0
|
|
|
|
|
|
|
|
- import_tasks: build/preconfigure-k3s-agent-config-yaml-d.yml
|
|
|
|
when:
|
|
|
|
- not k3s_control_node
|
|
|
|
- k3s_agent_config_yaml_d_files | length > 0
|
|
|
|
|
2019-12-20 20:03:27 +01:00
|
|
|
- import_tasks: build/install-k3s.yml
|
|
|
|
|
2021-05-07 12:29:01 +02:00
|
|
|
- name: Ensure containerd installation tasks are run
|
|
|
|
block:
|
|
|
|
- include_tasks: build/containerd/registries.yml
|
|
|
|
when:
|
|
|
|
- k3s_registries is defined
|
|
|
|
- (k3s_runtime_config.docker is not defined or not k3s_runtime_config.docker)
|
|
|
|
- ('rootless' not in k3s_runtime_config or not k3s_runtime_config.rootless)
|
|
|
|
|
2021-02-28 17:45:38 +01:00
|
|
|
- include_tasks: validate/configuration/cluster-init.yml
|
|
|
|
when:
|
|
|
|
- k3s_control_delegate is defined
|
|
|
|
- k3s_control_delegate == inventory_hostname
|
|
|
|
|
2019-12-20 20:03:27 +01:00
|
|
|
- import_tasks: build/configure-k3s-cluster.yml
|
2021-02-16 16:46:01 +01:00
|
|
|
when:
|
|
|
|
- k3s_build_cluster is defined
|
|
|
|
- k3s_build_cluster
|
2021-03-14 17:29:14 +01:00
|
|
|
- k3s_registration_address is defined
|