24 lines
982 B
YAML

---
- name: "stop and remove discourse container if it exist"
docker_container:
name: "{{applications | get_app_conf(application_id, 'container', True)}}"
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 | get_app_conf(application_id, 'network', True)}} {{ database_host }}
failed_when: >
result.rc != 0 and
'already exists in network' not in result.stderr
register: result
when: applications | get_app_conf(application_id, 'features.central_database', False)
listen: recreate discourse
- name: rebuild discourse
shell: ./launcher rebuild {{applications | get_app_conf(application_id, 'container', True)}}
args:
executable: /bin/bash
chdir: "{{docker_repository_directory }}"
listen: recreate discourse