mirror of
https://github.com/PyratLabs/ansible-role-k3s.git
synced 2024-09-27 04:03:43 +02:00
Compare commits
4 Commits
44635027ce
...
37cca2e487
Author | SHA1 | Date | |
---|---|---|---|
|
37cca2e487 | ||
|
41b938c8e7 | ||
|
cc64737bdc | ||
|
3f1d2da21b |
@ -6,8 +6,9 @@
|
|||||||
path: "{{ k3s_server_manifests_dir }}"
|
path: "{{ k3s_server_manifests_dir }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
when: >-
|
when: >-
|
||||||
k3s_server_manifests_templates | length > 0
|
k3s_primary_control_node and
|
||||||
or k3s_server_manifests_urls | length > 0
|
(k3s_server_manifests_templates | length > 0
|
||||||
|
or k3s_server_manifests_urls | length > 0)
|
||||||
become: "{{ k3s_become }}"
|
become: "{{ k3s_become }}"
|
||||||
|
|
||||||
- name: Ensure that the pod-manifests directory exists
|
- name: Ensure that the pod-manifests directory exists
|
||||||
@ -16,8 +17,9 @@
|
|||||||
path: "{{ k3s_server_pod_manifests_dir }}"
|
path: "{{ k3s_server_pod_manifests_dir }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
when: >-
|
when: >-
|
||||||
k3s_server_pod_manifests_templates | length > 0
|
k3s_control_node and
|
||||||
or k3s_server_pod_manifests_urls | length > 0
|
(k3s_server_pod_manifests_templates | length > 0
|
||||||
|
or k3s_server_pod_manifests_urls | length > 0)
|
||||||
become: "{{ k3s_become }}"
|
become: "{{ k3s_become }}"
|
||||||
|
|
||||||
# https://rancher.com/docs/k3s/latest/en/advanced/#auto-deploying-manifests
|
# https://rancher.com/docs/k3s/latest/en/advanced/#auto-deploying-manifests
|
||||||
@ -29,6 +31,7 @@
|
|||||||
loop: "{{ k3s_server_manifests_templates }}"
|
loop: "{{ k3s_server_manifests_templates }}"
|
||||||
become: "{{ k3s_become }}"
|
become: "{{ k3s_become }}"
|
||||||
when:
|
when:
|
||||||
|
- k3s_primary_control_node
|
||||||
- k3s_server_manifests_templates | length > 0
|
- k3s_server_manifests_templates | length > 0
|
||||||
|
|
||||||
- name: Ensure auto-deploying manifests are downloaded to the primary controller
|
- name: Ensure auto-deploying manifests are downloaded to the primary controller
|
||||||
@ -39,6 +42,7 @@
|
|||||||
loop: "{{ k3s_server_manifests_urls }}"
|
loop: "{{ k3s_server_manifests_urls }}"
|
||||||
become: "{{ k3s_become }}"
|
become: "{{ k3s_become }}"
|
||||||
when:
|
when:
|
||||||
|
- k3s_primary_control_node
|
||||||
- not ansible_check_mode
|
- not ansible_check_mode
|
||||||
- k3s_server_manifests_urls | length > 0
|
- k3s_server_manifests_urls | length > 0
|
||||||
|
|
||||||
@ -50,6 +54,8 @@
|
|||||||
mode: 0644
|
mode: 0644
|
||||||
loop: "{{ k3s_server_pod_manifests_templates }}"
|
loop: "{{ k3s_server_pod_manifests_templates }}"
|
||||||
become: "{{ k3s_become }}"
|
become: "{{ k3s_become }}"
|
||||||
|
when:
|
||||||
|
- k3s_control_node
|
||||||
|
|
||||||
# https://rancher.com/docs/k3s/latest/en/advanced/#auto-deploying-manifests
|
# https://rancher.com/docs/k3s/latest/en/advanced/#auto-deploying-manifests
|
||||||
- name: Ensure auto-deploying manifests are downloaded to the primary controller
|
- name: Ensure auto-deploying manifests are downloaded to the primary controller
|
||||||
@ -59,4 +65,6 @@
|
|||||||
mode: 0644
|
mode: 0644
|
||||||
loop: "{{ k3s_server_pod_manifests_urls }}"
|
loop: "{{ k3s_server_pod_manifests_urls }}"
|
||||||
become: "{{ k3s_become }}"
|
become: "{{ k3s_become }}"
|
||||||
when: not ansible_check_mode
|
when:
|
||||||
|
- k3s_control_node
|
||||||
|
- not ansible_check_mode
|
||||||
|
@ -19,8 +19,6 @@
|
|||||||
|
|
||||||
- name: Run auto-deploy manifests and pod manifests tasks
|
- name: Run auto-deploy manifests and pod manifests tasks
|
||||||
ansible.builtin.import_tasks: ensure_k3s_auto_deploy.yml
|
ansible.builtin.import_tasks: ensure_k3s_auto_deploy.yml
|
||||||
when:
|
|
||||||
- k3s_primary_control_node
|
|
||||||
|
|
||||||
- name: Ensure k3s configuration files are copied to controllers and agents
|
- name: Ensure k3s configuration files are copied to controllers and agents
|
||||||
ansible.builtin.import_tasks: ensure_k3s_config_files.yml
|
ansible.builtin.import_tasks: ensure_k3s_config_files.yml
|
||||||
@ -31,7 +29,7 @@
|
|||||||
- name: Ensure containerd registries
|
- name: Ensure containerd registries
|
||||||
ansible.builtin.include_tasks: ensure_containerd_registries.yml
|
ansible.builtin.include_tasks: ensure_containerd_registries.yml
|
||||||
when:
|
when:
|
||||||
- k3s_registries is defined
|
- (k3s_registries.mirrors | default(None)) != None or (k3s_registries.configs | default(None) != None)
|
||||||
- ('rootless' not in k3s_runtime_config or not k3s_runtime_config.rootless)
|
- ('rootless' not in k3s_runtime_config or not k3s_runtime_config.rootless)
|
||||||
|
|
||||||
- name: Run cluster pre-checks
|
- name: Run cluster pre-checks
|
||||||
|
Loading…
Reference in New Issue
Block a user