2020-01-11 15:44:28 +01:00
|
|
|
---
|
|
|
|
|
2020-01-13 22:32:31 +01:00
|
|
|
- name: Ensure that the manifests directory exists
|
2020-12-12 15:27:59 +01:00
|
|
|
ansible.builtin.file:
|
2020-01-11 18:56:48 +01:00
|
|
|
state: directory
|
|
|
|
path: "{{ k3s_server_manifests_dir }}"
|
2020-09-15 19:10:25 +02:00
|
|
|
mode: 0755
|
2020-01-11 18:56:48 +01:00
|
|
|
when: k3s_server_manifests_templates | length > 0
|
2020-12-21 20:14:52 +01:00
|
|
|
become: "{{ k3s_become_for_directory_creation | ternary(true, false, k3s_become_for_all) }}"
|
2020-01-11 18:56:48 +01:00
|
|
|
|
2020-01-11 15:44:28 +01:00
|
|
|
# https://rancher.com/docs/k3s/latest/en/advanced/#auto-deploying-manifests
|
2021-05-26 00:38:07 +02:00
|
|
|
- name: Ensure auto-deploying manifests are copied to the primary controller
|
2020-12-12 15:27:59 +01:00
|
|
|
ansible.builtin.template:
|
2020-01-11 15:10:19 +01:00
|
|
|
src: "{{ item }}"
|
|
|
|
dest: "{{ k3s_server_manifests_dir }}/{{ item | basename | replace('.j2','') }}"
|
2020-09-15 19:10:25 +02:00
|
|
|
mode: 0644
|
2020-01-11 20:03:58 +01:00
|
|
|
loop: "{{ k3s_server_manifests_templates }}"
|
2020-12-21 20:14:52 +01:00
|
|
|
become: "{{ k3s_become_for_directory_creation | ternary(true, false, k3s_become_for_all) }}"
|