2023-12-08 00:34:48 +01:00
|
|
|
---
|
|
|
|
- name: "include tasks nginx-docker-proxy-domain.yml"
|
|
|
|
include_tasks: nginx-docker-proxy-domain.yml
|
|
|
|
|
|
|
|
- name: "create {{docker_compose_instance_directory}}"
|
|
|
|
file:
|
|
|
|
path: "{{docker_compose_instance_directory}}"
|
|
|
|
state: directory
|
|
|
|
mode: 0755
|
|
|
|
|
|
|
|
#- name: add docker-compose.yml
|
|
|
|
# template: src=docker-compose.yml.j2 dest={{docker_compose_instance_directory}}docker-compose.yml
|
|
|
|
# notify: recreate discourse
|
|
|
|
|
|
|
|
- name: register directory
|
|
|
|
stat:
|
|
|
|
path: "{{docker_compose_instance_directory}}"
|
|
|
|
register: docker_compose_instance_directory_register
|
|
|
|
|
|
|
|
- name: checkout repository
|
|
|
|
ansible.builtin.shell: git checkout .
|
|
|
|
become: true
|
|
|
|
args:
|
|
|
|
chdir: "{{docker_compose_instance_directory}}"
|
|
|
|
when: docker_compose_instance_directory_register.stat.exists
|
|
|
|
|
|
|
|
- name: pull docker repository
|
|
|
|
git:
|
|
|
|
repo: "https://github.com/discourse/discourse_docker.git"
|
|
|
|
dest: "{{docker_compose_instance_directory}}"
|
|
|
|
update: yes
|
|
|
|
notify: recreate discourse
|
|
|
|
become: true
|
|
|
|
register: git_result
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- name: Warn if repo is not reachable
|
|
|
|
debug:
|
|
|
|
msg: "Warning: Repository is not reachable."
|
|
|
|
when: git_result.failed
|
|
|
|
|
2023-12-08 01:01:18 +01:00
|
|
|
- name: set chmod 700 for {{docker_compose_instance_directory}}containers
|
2023-12-08 00:34:48 +01:00
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{docker_compose_instance_directory}}/containers"
|
|
|
|
mode: '700'
|
|
|
|
state: directory
|
|
|
|
|
2023-12-08 01:01:18 +01:00
|
|
|
- name: "copy configuration {{docker_compose_instance_directory}}containers/app.yml"
|
2023-12-08 00:34:48 +01:00
|
|
|
template:
|
|
|
|
src: app.yml.j2
|
2023-12-08 01:01:18 +01:00
|
|
|
dest: "{{docker_compose_instance_directory}}containers/app.yml"
|
2023-12-08 00:34:48 +01:00
|
|
|
notify: recreate discourse
|