ansible-collections/sbc/roles/dietpi_install/tasks/copy_automation_script.yml

25 lines
826 B
YAML

---
- name: Set default path to place configs
ansible.builtin.set_fact:
config_path: "{{ (build_dir.path, 'mount') | path_join }}"
- name: Check if dietpi.txt exists in root
ansible.builtin.stat:
path: "{{ (config_path, 'dietpi.txt') | path_join }}"
register: dietpi_config_file
- name: Set config path into boot directory
ansible.builtin.set_fact:
config_path: "{{ (config_path, 'boot') | path_join }}"
when: not dietpi_config_file.stat.exists
- name: Template dietpi.txt
ansible.builtin.template:
src: dietpi.txt.j2
dest: "{{ (config_path, 'dietpi.txt') | path_join }}"
become: true
- name: Template dietpi-wifi.txt
ansible.builtin.template:
src: dietpi-wifi.txt.j2
dest: "{{ (config_path, 'dietpi-wifi.txt') | path_join }}"
when: wifi_enabled | default(False)
become: true