cookiecutter-ansible-role-d.../ansible-role-{{cookiecutter.app_name}}/tasks/config.yml
2023-01-11 21:29:23 +01:00

23 lines
932 B
YAML

---
- name: "{{ cookiecutter.app_name | upper }} | Set up directories"
ansible.builtin.file:
state: directory
path: "{%raw%}{{{%endraw%} item }}"
owner: "{%raw%}{{{%endraw%} ansible_effective_user_id {%raw%}}}{%endraw%}"
group: "{%raw%}{{{%endraw%} ansible_effective_group_id {%raw%}}}{%endraw%}"
mode: "0750"
with_items:
- "{%raw%}{{{%endraw%} {{ cookiecutter.app_name }}_skeleton_paths {%raw%}}}{%endraw%}"
tags:
- {{ cookiecutter.app_name }}_configure
become: true
- name: "{{ cookiecutter.app_name | upper }} | Write configuration files"
ansible.builtin.template:
src: "{%raw%}{{{%endraw%} item {%raw%}}}{%endraw%}.j2"
dest: "{%raw%}{{{%endraw%} {{ cookiecutter.app_name }}_config_path | expanduser | realpath {%raw%}}}{%endraw%}/{%raw%}{{{%endraw%} item {%raw%}{{{%endraw%}"
mode: '0640'
loop:
- "docker-compose.yml"
tags:
- {{ cookiecutter.app_name }}_configure