ansible-role-docker_synapse/tasks/main.yml

51 lines
1.2 KiB
YAML
Raw Normal View History

2022-08-15 14:33:26 +02:00
- 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