# vim: ft=yaml.ansible
---
- name: Create SimpleXMQ volume directories
ansible.builtin.file:
name: "{{ services.simplexmq.volume }}/{{ dir }}"
owner: root
mode: u=rwx,g=rx,o=rx
state: directory
loop:
- config
- logs
loop_control:
loop_var: dir
- name: Deploy SimpleXMQ Docker container
community.docker.docker_container:
name: simplexmq
state: "{{ 'absent' if stop is defined and stop else 'started' }}"
image: simplexchat/simplexmq:{{ services.simplexmq.version }}
restart_policy: always
networks:
- name: tor
aliases:
- simplexmq
env:
addr: "{{ services.simplexmq.domain }}"
volumes:
- "{{ services.simplexmq.volume }}/config:/etc/opt/simplex:rw"
- "{{ services.simplexmq.volume }}/logs:/var/opt/simplex:rw"
published_ports:
- 5223:5223/tcp
labels:
com.centurylinklabs.watchtower.stop-signal: SIGINT