From 910f5d0df0a82c82c71cc60273f1edd2bc742ab6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <j.l.k@gmx.com>
Date: Fri, 4 Sep 2020 21:17:06 +0200
Subject: [PATCH] aurweb: move tasks with configuration files before initdb
 which needs them

---
 roles/aurweb/tasks/main.yml | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/roles/aurweb/tasks/main.yml b/roles/aurweb/tasks/main.yml
index 4e262a5e6..a411945a8 100644
--- a/roles/aurweb/tasks/main.yml
+++ b/roles/aurweb/tasks/main.yml
@@ -63,6 +63,16 @@
     - 'uploads'
     - 'web/html/trusted-user'
 
+- name: create aurweb conf dir
+  file: path={{ aurweb_conf_dir }} state=directory owner=root group=root mode=0755
+
+- name: copy aurweb configuration file
+  copy: src={{ aurweb_dir }}/conf/config.defaults dest={{ aurweb_conf_dir }}/config.defaults remote_src=yes owner=root group=root mode=0644
+
+# Note: initdb needs the config
+- name: install custom aurweb configuration
+  template: src=config.j2 dest={{ aurweb_conf_dir }}/config owner=root group=root mode=0644
+
 - name: create aur db
   mysql_db: name="{{ aurweb_db }}" login_host="{{ aurweb_db_host }}" login_password="{{ vault_mariadb_users.root }}" encoding=utf8
   register: db_created
@@ -90,15 +100,6 @@
   become_user: "{{ aurweb_user }}"
   when: release.changed or db_created.changed
 
-- name: create aurweb conf dir
-  file: path={{ aurweb_conf_dir }} state=directory owner=root group=root mode=0755
-
-- name: copy aurweb configuration file
-  copy: src={{ aurweb_dir }}/conf/config.defaults dest={{ aurweb_conf_dir }}/config.defaults remote_src=yes owner=root group=root mode=0644
-
-- name: install custom aurweb configuration
-  template: src=config.j2 dest={{ aurweb_conf_dir }}/config owner=root group=root mode=0644
-
 - name: Install python module
   command: "python3 setup.py install --install-scripts=/usr/local/bin"
   args:
-- 
GitLab