system-config/playbooks/roles/statusbot/tasks/main.yaml
Ian Wienand 23fac31c92 Run statusbot from eavesdrop01.opendev.org
This installs statusbot on eavesdrop01.opendev.org.

Otherwise it's just config translation and bringing up the daemon.

Change-Id: I246b2723372594e65bcd1ba90215d6831d4c0c72
2021-06-11 07:52:51 +10:00

53 lines
1.2 KiB
YAML

- name: Ensure statusbot directories
file:
state: directory
path: '{{ item }}'
owner: root
group: root
mode: 0755
loop:
- /etc/statusbot
- /etc/statusbot-docker
- /var/log/statusbot
- /var/lib/statusbot
- /var/lib/statusbot/www
- name: Put statusbot config in place
template:
src: statusbot.config.j2
dest: /etc/statusbot/statusbot.config
owner: root
group: root
mode: 0600
register: statusbot_config_copied
- name: Put statusbot logging config in place
copy:
src: logging.config
dest: /etc/statusbot/logging.config
owner: root
group: root
mode: 0644
- name: Put docker-compose file in place
copy:
src: docker-compose.yaml
dest: /etc/statusbot-docker/docker-compose.yaml
owner: root
group: root
mode: 0644
- name: Run docker-compose pull
shell:
cmd: docker-compose pull
chdir: /etc/statusbot-docker/
- name: Run docker-compose up
shell:
cmd: "docker-compose up -d {{ statusbot_config_copied is changed | ternary('--force-recreate', '') }}"
chdir: /etc/statusbot-docker/
- name: Run docker prune to cleanup unneeded images
shell:
cmd: docker image prune -f