👌 pottwal: Check prosody data dir exists

Suggested-by: Stefan Haun <tux@netz39.de>
This commit is contained in:
Alexander Dahl 2022-09-15 21:42:32 +02:00
parent 3537e91e35
commit e483d0f19c

View file

@ -12,7 +12,7 @@
shlink_host_port: 8083 shlink_host_port: 8083
shlink_domain_name: sl.n39.eu shlink_domain_name: sl.n39.eu
prosody_data: "{{ data_dir }}/prosody" prosody_data_dir: "{{ data_dir }}/prosody"
prosody_domain_name: jabber.n39.eu prosody_domain_name: jabber.n39.eu
jabber_host_port: 8086 jabber_host_port: 8086
@ -127,6 +127,15 @@
site_name: "{{ shlink_domain_name }}" site_name: "{{ shlink_domain_name }}"
proxy_port: "{{ shlink_host_port }}" proxy_port: "{{ shlink_host_port }}"
- name: Check if prosody data dir exists
ansible.builtin.stat:
path: "{{ prosody_data_dir }}"
register: prosody_dir
- name: Fail if prosody data dir does not exist
ansible.builtin.fail:
msg: "prosody data dir is missing, please restore from the backup!"
when: not prosody.stat.exists
- name: Ensure container for prosody XMPP server is running - name: Ensure container for prosody XMPP server is running
docker_container: docker_container:
name: prosody name: prosody
@ -140,9 +149,9 @@
- 5222:5222 # xmpp-client - 5222:5222 # xmpp-client
- 5269:5269 # xmpp-server - 5269:5269 # xmpp-server
volumes: volumes:
- "{{ prosody_data }}/etc/prosody:/etc/prosody:rw" - "{{ prosody_data_dir }}/etc/prosody:/etc/prosody:rw"
- "{{ prosody_data }}/var/lib/prosody:/var/lib/prosody:rw" - "{{ prosody_data_dir }}/var/lib/prosody:/var/lib/prosody:rw"
- "{{ prosody_data }}/var/log/prosody:/var/log/prosody:rw" - "{{ prosody_data_dir }}/var/log/prosody:/var/log/prosody:rw"
- "{{ dehydrated_certs_dir }}/{{ prosody_domain_name }}:/var/lib/dehydrated/certs/{{ prosody_domain_name }}:ro" - "{{ dehydrated_certs_dir }}/{{ prosody_domain_name }}:/var/lib/dehydrated/certs/{{ prosody_domain_name }}:ro"
- name: Ensure container for static XMPP website is running - name: Ensure container for static XMPP website is running
@ -160,7 +169,7 @@
ports: ports:
- "127.0.0.1:{{ jabber_host_port }}:80" - "127.0.0.1:{{ jabber_host_port }}:80"
volumes: volumes:
- "{{ prosody_data }}/var/www:/public:ro" - "{{ prosody_data_dir }}/var/www:/public:ro"
- name: Setup proxy site {{ prosody_domain_name }} - name: Setup proxy site {{ prosody_domain_name }}
# point to static website for now # point to static website for now