Skip to content

Commit

Permalink
CKAN DB init check: change failed value
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
stsnel committed Mar 28, 2024
1 parent 70a5371 commit e1a8dc4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions roles/ckan/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
become: true
become_user: postgres
ansible.builtin.command: 'psql -d ckan_default -c "select * from public.user"'
ignore_errors: true
failed_when: "userlist.rc != 0 and 'ERROR: relation \"public.user\" does not exist' not in userlist.stderr"
register: userlist
changed_when: false
vars:
Expand All @@ -277,13 +277,13 @@
vars:
# Pipelininig is needed for internal temporary files
ansible_ssh_pipelining: true
when: 'userlist.rc !=0 or "default" not in userlist.stdout'
when: 'userlist.rc != 0 or "default" not in userlist.stdout'

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

- name: Check if CKAN admin user exists
become_user: root
Expand Down

0 comments on commit e1a8dc4

Please sign in to comment.