homeserver/roles/PyratLabs.k3s/tasks/ensure_k3s_config_files.yml
mg 3cc377c1a7 Rolle aktualisiert: k3s (#455)
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: #455
2023-02-17 12:00:24 +01:00

31 lines
1,002 B
YAML

---
- name: Ensure that the config.yaml.d directory exists
ansible.builtin.file:
state: directory
path: "{{ k3s_config_yaml_d_dir }}"
mode: 0755
when: >-
k3s_server_config_yaml_d_files | length > 0
or k3s_agent_config_yaml_d_files | length > 0
become: "{{ k3s_become }}"
# https://github.com/k3s-io/k3s/pull/3162
- name: Ensure configuration files are copied to controllers
ansible.builtin.template:
src: "{{ item }}"
dest: "{{ k3s_config_yaml_d_dir }}/{{ item | basename | replace('.j2', '') }}"
mode: 0644
loop: "{{ k3s_server_config_yaml_d_files }}"
become: "{{ k3s_become }}"
when: k3s_control_node
# https://github.com/k3s-io/k3s/pull/3162
- name: Ensure configuration files are copied to agents
ansible.builtin.template:
src: "{{ item }}"
dest: "{{ k3s_config_yaml_d_dir }}/{{ item | basename | replace('.j2', '') }}"
mode: 0644
loop: "{{ k3s_agent_config_yaml_d_files }}"
become: "{{ k3s_become }}"
when: not k3s_control_node