added permanent solution to dbschema install and db check

This commit is contained in:
muppeth 2024-02-22 13:26:25 +01:00
parent efb1e5c9a3
commit 08db441e2d
Signed by: muppeth
GPG Key ID: 0EBC7B9848D04031
1 changed files with 2 additions and 1 deletions

View File

@ -77,7 +77,7 @@
- name: Check if the database exists
shell:
cmd: mysql -h {{ lacre_db_host }} -u {{ lacre_db_username }} -p{{ lacre_db_password }} {{ lacre_db_name }} -se "SHOW TABLES";
cmd: mysql -h {{ lacre_db_host }} -u {{ lacre_db_username }} -p{{ lacre_db_password }} {{ lacre_db_name }} -se "SHOW TABLES;" | wc -l
register: lacre_db_info
ignore_errors: yes
@ -86,4 +86,5 @@
cmd: '{{ lacre_homedir }}/venv/bin/python{{ lacre_python_version }} -m {{ lacre_app_dir }}/lacre/lacre.admin db -i'
become: 'yes'
become_user: '{{ lacre_username }}'
when: lacre_db_info.stdout != '3'