added schema check
This commit is contained in:
parent
4a2b9c13a8
commit
2f1375e671
1 changed files with 3 additions and 2 deletions
|
@ -12,9 +12,9 @@
|
|||
owner: "{{ lacre_webgate_user }}"
|
||||
group: "{{ lacre_webgate_group }}"
|
||||
|
||||
- name: '[Webgate] - Chec if db has tables'
|
||||
- name: '[Webgate] - Check if db schema is loaded'
|
||||
shell:
|
||||
cmd: "mysql -h {{ rcube_db_hostname }} -u {{ lacre_db_username }} -p{{ lacre_db_password }} {{ lacre_db_name }} -se 'select * from gpgmw_keys;'"
|
||||
cmd: mysql -h {{ lacre_db_host }} -u {{ lacre_db_username }} -p{{ lacre_db_password }} {{ lacre_db_name }} -se "SELECT EXISTS (SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA LIKE '{{ lacre_db_name }}' AND TABLE_TYPE LIKE 'BASE TABLE' AND TABLE_NAME = 'gpgmw_keys' );"
|
||||
register: webgate_installed
|
||||
ignore_errors: true
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
|||
login_user: "{{ lacre_db_username }}"
|
||||
login_password: "{{ lacre_db_password }}"
|
||||
target: "{{ lacre_app_dir }}/gpg-mailgate-web/schema.sql"
|
||||
when: webgate_installed.stdout != '1'
|
||||
|
||||
- name: 'Webgate] - Deploy config'
|
||||
template:
|
||||
|
|
Loading…
Reference in a new issue