--- a/prosody/tasks/main.yaml Sun Jun 14 14:50:21 2020 -0500
+++ b/prosody/tasks/main.yaml Sun Jun 14 15:22:14 2020 -0500
@@ -2,8 +2,11 @@
- name: install prosody
become: yes
- apt: name="prosody"
+ apt: name="{{item}}"
notify: restart prosody
+ loop:
+ - "prosody"
+ - "lua-dbi-postgresql"
- name: configure prosody
become: yes
@@ -31,6 +34,22 @@
- "{{prosody_ssl_privkey_src}}"
- "{{prosody_ssl_cert_src}}"
+- name: install db schema file
+ become: yes
+ template:
+ src: "setup_db.psql.j2"
+ dest: "/tmp/setup_db_{{prosody_db}}.psql"
+ owner: "postgres"
+ group: "postgres"
+ mode: "0600"
+ changed_when: false
+
+- name: install psql
+ become: yes
+ become_user: "postgres"
+ command: "psql -f /tmp/setup_db_{{prosody_db}}.psql"
+ changed_when: false
+
- name: enable prosody site
become: yes
file: