diff --git a/host-pottwal.yml b/host-pottwal.yml index 8803cff..5d683a0 100644 --- a/host-pottwal.yml +++ b/host-pottwal.yml @@ -125,10 +125,34 @@ msg: "prosody data dir is missing, please restore from the backup!" when: not prosody_dir.stat.exists + - name: Ensure prosody config dir exists + ansible.builtin.file: + path: "{{ prosody_config_dir }}" + state: directory + mode: 0755 + + - name: Ensure prosody certs dir exists + ansible.builtin.file: + path: "{{ prosody_config_dir }}/certs" + state: directory + mode: 0750 + + - name: Ensure prosody conf.avail dir exists + ansible.builtin.file: + path: "{{ prosody_config_dir }}/conf.avail" + state: directory + mode: 0755 + + - name: Ensure prosody certs dir exists + ansible.builtin.file: + path: "{{ prosody_config_dir }}/conf.d" + state: directory + mode: 0755 + - name: Ensure prosody main config file is in place ansible.builtin.template: src: "templates/prosody/prosody.cfg.lua.j2" - dest: "{{ prosody_data_dir }}/etc/prosody/prosody.cfg.lua" + dest: "{{ prosody_config_dir }}/prosody.cfg.lua" mode: 0644 notify: - Restart prosody @@ -136,7 +160,7 @@ - name: "Ensure prosody config file is in place: {{ prosody_domain_name }}" ansible.builtin.copy: src: "files/prosody/{{ prosody_domain_name }}.cfg.lua" - dest: "{{ prosody_data_dir }}/etc/prosody/conf.avail/{{ prosody_domain_name }}.cfg.lua" + dest: "{{ prosody_config_dir }}/conf.avail/{{ prosody_domain_name }}.cfg.lua" mode: 0644 notify: - Restart prosody @@ -144,7 +168,7 @@ - name: "Ensure prosody config symlink exists: {{ prosody_domain_name }}" ansible.builtin.file: src: "../conf.avail/{{ prosody_domain_name }}.cfg.lua" - dest: "{{ prosody_data_dir }}/etc/prosody/conf.d/{{ prosody_domain_name }}.cfg.lua" + dest: "{{ prosody_config_dir }}/conf.d/{{ prosody_domain_name }}.cfg.lua" state: link notify: - Restart prosody @@ -162,7 +186,7 @@ - 5222:5222 # xmpp-client - 5269:5269 # xmpp-server volumes: - - "{{ prosody_data_dir }}/etc/prosody:/etc/prosody:rw" + - "{{ prosody_config_dir }}:/etc/prosody:rw" - "{{ prosody_data_dir }}/var/lib/prosody:/var/lib/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" diff --git a/host_vars/pottwal.n39.eu/vars.yml b/host_vars/pottwal.n39.eu/vars.yml index c70ce80..7e12fe0 100644 --- a/host_vars/pottwal.n39.eu/vars.yml +++ b/host_vars/pottwal.n39.eu/vars.yml @@ -31,6 +31,7 @@ influxdb_init_password: "{{ vault_influxdb_init_password }}" gitea_host_port: 9091 +prosody_config_dir: "/etc/prosody" prosody_data_dir: "{{ data_dir }}/prosody" prosody_domain_name: jabber.n39.eu jabber_host_port: 8086