51 lines
1.2 KiB
YAML
51 lines
1.2 KiB
YAML
|
- name: docker directory
|
||
|
file:
|
||
|
path: /opt/{{ docker_synapse_service_id }}/
|
||
|
state: directory
|
||
|
|
||
|
- name: prepare docker-compose.yml
|
||
|
template:
|
||
|
src: "{{ item }}"
|
||
|
dest: /opt/{{ docker_synapse_service_id }}/
|
||
|
with_items:
|
||
|
- docker-compose.yml
|
||
|
notify: docker-compose-up
|
||
|
|
||
|
|
||
|
- name: generate secrets
|
||
|
when: docker_synapse_gen_config is true
|
||
|
block:
|
||
|
|
||
|
- name: docker-compose-gen-config
|
||
|
shell: |
|
||
|
docker-compose down
|
||
|
docker-compose run --rm synapse generate
|
||
|
cp -a {{ docker_synapse_data_dir }}/{{ docker_synapse_service_id }}/synapse_data/homeserver.yaml /opt/{{ docker_synapse_service_id }}/
|
||
|
args:
|
||
|
chdir: /opt/{{ docker_synapse_service_id }}/
|
||
|
register: config
|
||
|
|
||
|
- debug:
|
||
|
msg: "{{ config.stdout_lines }}"
|
||
|
|
||
|
- debug:
|
||
|
msg: "Récupérer les valeurs suivantes du fichier de configuration qui vient d'être généré pour alimenter les variables du playbook synapse"
|
||
|
|
||
|
|
||
|
- name: Playbook stops here if docker_synapse_gen_config is set
|
||
|
assert:
|
||
|
that:
|
||
|
- docker_synapse_gen_config is false
|
||
|
|
||
|
|
||
|
- name: prepare configuration
|
||
|
template:
|
||
|
src: "{{ item }}"
|
||
|
dest: /opt/{{ docker_synapse_service_id }}/
|
||
|
with_items:
|
||
|
- homeserver.yaml
|
||
|
notify: docker-compose-up
|
||
|
|
||
|
|
||
|
|