homelab/roles/prosody/tasks/main.yml

62 lines
1.6 KiB
YAML
Raw Normal View History

2024-10-29 00:12:08 +05:00
---
- name: Create prosody volume
become: true
community.docker.docker_volume:
name: prosody
- name: Create prosody config dir
become: true
ansible.builtin.file:
path: /etc/prosody
state: directory
owner: root
mode: "1700"
- name: Create prosody config dir
become: true
ansible.builtin.file:
path: /etc/prosody/_data
state: directory
owner: "101"
mode: "1700"
- name: Copy prosody config
become: true
ansible.builtin.template:
src: prosody.cfg.lua.j2
dest: /etc/prosody/_data/prosody.cfg.lua
owner: "101"
register: cfg
- name: Copy tls certificate
become: true
ansible.builtin.copy:
remote_src: true
src: "{{ tls_cert_path }}"
dest: /etc/prosody/_data/fullchain.pem
register: tls_cert_state
- name: Copy tls private key
become: true
ansible.builtin.copy:
remote_src: true
src: "{{ tls_key_path }}"
dest: /etc/prosody/_data/privkey.pem
register: tls_key_state
- name: Run prosody container
become: true
community.docker.docker_container:
name: prosody
image: git.comfycamp.space/lumin/prosody:v0.0.2
networks:
- name: postgresql
- name: haproxy
2024-10-29 00:12:08 +05:00
ports:
- "5000:5000"
- "5222:5222"
- "5223:5223"
- "5269:5269"
- "5281:5281"
volumes:
- prosody:/var/lib/prosody
- /etc/prosody/_data:/etc/prosody:ro
- "{{ tls_cert_path }}:/etc/tls/fullchain.pem:ro"
- "{{ tls_key_path }}:/etc/tls/privkey.pem:ro"
recreate: "{{ cfg.changed or tls_cert_state.changed or tls_key_state.changed }}"
2024-10-30 17:55:20 +05:00
restart_policy: unless-stopped