diff --git a/roles/docker_services/defaults/main.yml b/roles/docker_services/defaults/main.yml index 0101561..5cbafb0 100644 --- a/roles/docker_services/defaults/main.yml +++ b/roles/docker_services/defaults/main.yml @@ -29,6 +29,11 @@ services: postgres_version: 14-alpine redis_version: 7-alpine + simplexmq: + domain: smp01.simplex.{{ base_domain }} + volume: "{{ base_volume }}/simplexmq" + version: latest + snowflake: version: latest diff --git a/roles/docker_services/tasks/services/simplexmq.yml b/roles/docker_services/tasks/services/simplexmq.yml new file mode 100644 index 0000000..33a554f --- /dev/null +++ b/roles/docker_services/tasks/services/simplexmq.yml @@ -0,0 +1,36 @@ +# vim: ft=yaml.ansible +--- +- name: Create SimpleXMQ config directory + ansible.builtin.file: + name: "{{ services.simplexmq.volume }}/config" + owner: root + mode: u=rwx,g=rx,o=rx + state: directory + +- name: Create SimpleXMQ logs directory + ansible.builtin.file: + name: "{{ services.simplexmq.volume }}/logs" + owner: root + mode: u=rwx,g=rx,o=rx + state: directory + +- name: Create Docker network for SimpleXMQ + community.docker.docker_network: + name: simplexmq + state: present + +- 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: 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 diff --git a/roles/os_config/tasks/firewall.yml b/roles/os_config/tasks/firewall.yml index 53d5ea6..660bc23 100644 --- a/roles/os_config/tasks/firewall.yml +++ b/roles/os_config/tasks/firewall.yml @@ -9,6 +9,7 @@ - port: '22' # SSH - port: '80' # HTTP - port: '443' # HTTPS + - port: '5223' # SimpleXMQ - port: '18080' # monerod P2P - port: '18089' # monerod RPC - port: '51820' # Wireguard