Commit 1db4302d authored by godog's avatar godog

mariadb: write data directory sentinel file

More robust in case mysql_install_db fails but creates the directory.

Note this will require to manually create the sentinel file for data
directories already bootstrapped.
parent c1277173
Pipeline #5928 failed with stage
in 21 seconds
......@@ -104,9 +104,9 @@
register: mariadb_systemd_unit
- name: Bootstrap data directory
command: "/usr/bin/mysql_install_db --defaults-file={{ mariadb_config }} --datadir={{ mariadb_data_dir }} --user=mysql --auth-root-authentication-method=socket {{ float_debian_dist == 'stretch' and '--skip-auth-anonymous-user' or '' }}"
shell: "/usr/bin/mysql_install_db --defaults-file={{ mariadb_config }} --datadir={{ mariadb_data_dir }} --user=mysql --auth-root-authentication-method=socket {{ float_debian_dist == 'stretch' and '--skip-auth-anonymous-user' or '' }} && date > {{ mariadb_data_dir }}/.float-bootstrap-ok"
args:
creates: "{{ mariadb_data_dir }}"
creates: "{{ mariadb_data_dir }}/.float-bootstrap-ok"
# Explicitly start the service after bootstrapping data directory
# instead of using a restart handler, so that the database is available
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment