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