]> git.ekhem.eu.org Git - turnup.git/commitdiff
Recreate the database before configuring other services.
authorJakub Czajka <jakub@ekhem.eu.org>
Mon, 4 Dec 2023 09:44:57 +0000 (10:44 +0100)
committerJakub Czajka <jczajka@google.com>
Sun, 24 Dec 2023 18:46:45 +0000 (19:46 +0100)
install/database.yaml [new file with mode: 0644]
turnup.yaml

diff --git a/install/database.yaml b/install/database.yaml
new file mode 100644 (file)
index 0000000..5f246e7
--- /dev/null
@@ -0,0 +1,8 @@
+# Copyright (c) 2023 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+
+- name: Execute postgres playbook
+  shell: /usr/bin/ansible-playbook --connection=local \
+    /srv/git/server.git/postgres.yaml
+- name: Restore database from backup
+  command: /usr/bin/psql --username=postgres --file=/tmp/database
index 5b0dd6ef0d40fa32ee28975594814d591a56f690..e27d9979e03c6e0be39c968612d86e3fc8ea8ca3 100644 (file)
@@ -23,6 +23,8 @@
     - include_tasks: install/certify.yaml
       with_items: "{{ certificates }}"
     - include_tasks: install/environment.yaml
+    - include_tasks: install/database.yaml
+
     - find:
         paths: "/srv/git"
         file_type: file
     - name: Execute configuration playbook
       shell: /usr/bin/ansible-playbook --connection=local {{ item.path }}
       with_items: "{{ post_receive_scripts.files }}"
-    - name: Restart postgresql
-      service:
-        name: postgresql
-        state: restarted
-      become: yes
-    - name: Restore database from backup
-      command: /usr/bin/psql --username=postgres --file=/tmp/database
     - include_tasks: install/ssh_public_keys.yaml
       with_items: "{{ users }}"