library/roles/ckan/ckan/tasks/ckan.yml: Change strategy to decide if the DB needs to be initialized.

This commit is contained in:
Andrea Dell'Amico 2017-04-06 10:24:40 +02:00
parent 42208fcfb0
commit 58aa726c57
1 changed files with 3 additions and 2 deletions

View File

@ -33,8 +33,9 @@
tags: [ 'pg_backup', 'postgresql', 'postgres' ] tags: [ 'pg_backup', 'postgresql', 'postgres' ]
- name: Initialize the CKAN databases - name: Initialize the CKAN databases
shell: ckan db init ; ckan datastore set-permissions | psql --set ON_ERROR_STOP=1 -h {{ psql_db_host }} -U {{ ckan_db_user }} -w {{ ckan_datastore_db_name }} shell: ckan db init ; ckan datastore set-permissions | psql --set ON_ERROR_STOP=1 -h {{ psql_db_host }} -U {{ ckan_db_user }} -w {{ ckan_datastore_db_name }} ; touch {{ ckan_libdir }}/.ckan_db_initialized
when: ( ckan_install | changed ) args:
creates: '{{ ckan_libdir }}/.ckan_db_initialized'
ignore_errors: True ignore_errors: True
tags: ckan tags: ckan