vps/roles/stump/tasks/setup.yml

30 lines
809 B
YAML

- name: "(Re)Create {{ project_dir }} project directory"
file:
path: "{{ project_dir }}"
state: "{{ item }}"
loop:
- absent
- directory
- name: Template docker-compose.yaml to project directory
template:
src: "{{ item }}"
dest: "{{ project_dir }}/{{ item }}"
owner: "{{ host_uid }}"
group: "{{ host_uid }}"
mode: '640'
loop:
- docker-compose.yaml
- name: "Create (if not exists) directories {{ volumes['stump_configdir'] }} and {{ volumes['stump_datadir'] }} & set permissions"
file:
path: "{{ item }}"
state: directory
owner: "{{ users['stump'] + uid_shift }}"
group: "{{ users['stump'] + uid_shift }}"
mode: '700'
recurse: true
become: true
loop:
- "{{ volumes['stump_datadir'] }}"
- "{{ volumes['stump_configdir'] }}"