ansible-role-k3s/tasks/build/preconfigure-k3s-agent-config-yaml-d.yml

19 lines
693 B
YAML
Raw Normal View History

2021-09-06 14:46:49 +02:00
---
- name: Ensure that the config.yaml.d directory exists
ansible.builtin.file:
state: directory
path: "{{ k3s_config_yaml_d_dir }}"
mode: 0755
when: k3s_agent_config_yaml_d_files | length > 0
become: "{{ k3s_become_for_directory_creation | ternary(true, false, k3s_become_for_all) }}"
2021-09-06 14:54:33 +02:00
# https://github.com/k3s-io/k3s/pull/3162
2021-09-06 14:47:37 +02:00
- name: Ensure configuration files are copied to agents
2021-09-06 14:46:49 +02:00
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_for_directory_creation | ternary(true, false, k3s_become_for_all) }}"