Made pleroma roles idempotent.
authorLuke Hoersten <luke@hoersten.org>
Mon, 20 Jan 2020 15:26:33 -0600
changeset 92 d4924111ce28
parent 91 d1406d67c758
child 93 976670b2ca63
Made pleroma roles idempotent.
roles/nginx/tasks/main.yaml
roles/pleroma-otp/tasks/main.yaml
--- a/roles/nginx/tasks/main.yaml	Mon Jan 20 14:19:05 2020 -0600
+++ b/roles/nginx/tasks/main.yaml	Mon Jan 20 15:26:33 2020 -0600
@@ -18,7 +18,7 @@
 - name: install certbot in nginx
   become: yes
   command: "certbot certonly --nginx -n --agree-tos -d {{nginx_server_name}} -m {{nginx_admin_email}}"
-  notify: restart nginx
+  changed_when: false
   when: nginx_enable_certbot
 
 - name: disable default site
--- a/roles/pleroma-otp/tasks/main.yaml	Mon Jan 20 14:19:05 2020 -0600
+++ b/roles/pleroma-otp/tasks/main.yaml	Mon Jan 20 15:26:33 2020 -0600
@@ -40,19 +40,20 @@
     - "{{pleroma_data_dir}}/{{pleroma_instance}}/static/emoji"
 
 - name: install pleroma db schema file
+  become: yes
   template:
     src: "setup_db.psql.j2"
-    dest: "/tmp/setup_db.psql"
+    dest: "/tmp/setup_db_{{pleroma_instance}}.psql"
     owner: "{{pleroma_db_superuser}}"
     group: "{{pleroma_db_superuser}}"
     mode: "0600"
-  become: yes
+  changed_when: false
 
 - name: install pleroma psql
   become: yes
   become_user: "{{pleroma_db_superuser}}"
-  command: "psql -f /tmp/setup_db.psql"
-  notify: restart pleroma instance
+  command: "psql -f /tmp/setup_db_{{pleroma_instance}}.psql"
+  changed_when: false
 
 - name: download and unarchive pleroma release
   become: yes
@@ -98,4 +99,4 @@
     chdir: "/opt/pleroma/"
   environment:
     PLEROMA_CONFIG_PATH: "/etc/pleroma/{{pleroma_instance}}.config.exs"
-  notify: restart pleroma instance
+  changed_when: false