23 lines
867 B
YAML

---
- name: "stop and remove discourse container if it exist"
docker_container:
name: "{{applications.discourse.container}}"
state: absent
register: container_action
failed_when: container_action.failed and 'No such container' not in container_action.msg
listen: recreate discourse
- name: "add central database temporary to {{application_id}}_default"
command: docker network connect {{applications.discourse.network}} central-{{ database_type }}
failed_when: >
result.rc != 0 and
'already exists in network' not in result.stderr
register: result
when: applications | is_feature_enabled('central_database', application_id)
listen: recreate discourse
- name: rebuild discourse
command:
cmd: "./launcher rebuild {{applications.discourse.container}}"
chdir: "{{docker_repository_directory }}"
listen: recreate discourse