Skip to content

Commit e1a8dc4

Browse files
committed
CKAN DB init check: change failed value
Only display DB init check as failed if an unexpected failure occurs, not if the DB is not initialized yet (which is expected when running the playbook for the first time)
1 parent 70a5371 commit e1a8dc4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

roles/ckan/tasks/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@
263263
become: true
264264
become_user: postgres
265265
ansible.builtin.command: 'psql -d ckan_default -c "select * from public.user"'
266-
ignore_errors: true
266+
failed_when: "userlist.rc != 0 and 'ERROR: relation \"public.user\" does not exist' not in userlist.stderr"
267267
register: userlist
268268
changed_when: false
269269
vars:
@@ -277,13 +277,13 @@
277277
vars:
278278
# Pipelininig is needed for internal temporary files
279279
ansible_ssh_pipelining: true
280-
when: 'userlist.rc !=0 or "default" not in userlist.stdout'
280+
when: 'userlist.rc != 0 or "default" not in userlist.stdout'
281281

282282
# Reload supervisorctl as task, because there is no way to enforce ordering in
283283
# Ansible handlers, and we need to reload before we can start tasks.
284284
- name: Reload supervisorctl # noqa command-instead-of-module
285285
ansible.builtin.command: supervisorctl reload
286-
when: 'userlist.rc !=0 or "default" not in userlist.stdout'
286+
when: 'userlist.rc != 0 or "default" not in userlist.stdout'
287287

288288
- name: Check if CKAN admin user exists
289289
become_user: root

0 commit comments

Comments
 (0)