mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-26 21:45:20 +02:00
24 lines
741 B
YAML
24 lines
741 B
YAML
|
|
- name: "create {{ systemctl_script_dir }}"
|
|
file:
|
|
path: "{{ systemctl_script_dir }}"
|
|
state: directory
|
|
mode: "0755"
|
|
|
|
- name: "template or copy script"
|
|
block:
|
|
- name: "render template"
|
|
template:
|
|
src: "{{ systemctl_script_src }}"
|
|
dest: "{{ [systemctl_script_dir, (systemctl_script_src | basename | regex_replace('\\.j2$', ''))] | path_join }}"
|
|
mode: "0755"
|
|
when: systemctl_script_src.endswith('.j2')
|
|
|
|
- name: "copy raw file"
|
|
copy:
|
|
src: "{{ systemctl_script_src }}"
|
|
dest: "{{ [systemctl_script_dir, (systemctl_script_src | basename)] | path_join }}"
|
|
mode: "0755"
|
|
when: not systemctl_script_src.endswith('.j2')
|
|
when: systemctl_copy_files | bool
|