automation/deployer/roles/build/tasks/render.yml

27 lines
841 B
YAML
Raw Normal View History

---
# Needs variables:
# - site: dict describing the site install (cf group_vars/all/vars.yml)
# - any vars you use in roles/build/templates/{{ site.type }}
- name: "Create folder {{ sites_path }}/{{ site.slug }}"
file:
path: "{{ sites_path }}/{{ site.slug }}"
state: directory
mode: '750'
- name: "Create {{ sites_path }}/{{ site.slug }} sub-directories"
file:
path: "{{ sites_path }}/{{ site.slug }}/{{ item.path }}"
state: directory
mode: "{{ item.mode }}"
with_filetree: "../templates/{{ site.type }}/"
when: item.state == 'directory'
- name: Render template files
template:
src: "{{ item.src }}"
dest: "{{ sites_path }}/{{ site.slug }}/{{ item.path | regex_replace('.j2','') }}"
mode: "{{ item.mode }}"
with_filetree: "../templates/{{ site.type }}/"
when: item.state == 'file'