49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
---
|
|
- name: "set local variables from overrides and defaults"
|
|
set_fact:
|
|
localservices: "{{ (localservices_defaults | combine(localservices_override, recursive=True)) if localservices_override else localservices_defaults }}"
|
|
|
|
- name: ensure that path exists
|
|
file:
|
|
path: "{{ path }}/config/wg_confs"
|
|
state: directory
|
|
|
|
- import_role:
|
|
name: storage_mount
|
|
vars:
|
|
storage_mount_override:
|
|
host: "{{ localservices.networkmount.host }}"
|
|
host_path: "{{ localservices.networkmount.host_path }}"
|
|
args: "{{ localservices.networkmount.args }}"
|
|
dest_path: "{{ localservices.networkmount.dest_path }}"
|
|
when: localservices.networkmount.host | length > 1
|
|
|
|
- name: write wg0.conf
|
|
copy:
|
|
content: "{{ localservices.wg_client.wg_conf }}"
|
|
dest: "{{ path }}/config/wg0.conf"
|
|
|
|
- name: populate i2psnark templates
|
|
template:
|
|
src: "i2psnark/{{ item.path }}"
|
|
dest: "{{ path }}/config/{{ item.path | regex_replace('\\.j2$', '') }}"
|
|
with_filetree: "{{ role_path }}/templates/i2psnark"
|
|
when: localservices.i2psnark.url | length > 0
|
|
|
|
- name: copy docker files for i2psnark
|
|
copy:
|
|
src: i2psnark
|
|
dest: "{{ path }}"
|
|
|
|
- name: template docker compose
|
|
template:
|
|
src: "compose.yml.j2"
|
|
dest: "{{ path }}/compose.yml"
|
|
|
|
- name: ensure everything is up
|
|
community.docker.docker_compose_v2:
|
|
project_src: "{{ path }}"
|
|
project_name: "{{ role_name }}"
|
|
recreate: always
|
|
state: "present"
|