Skip to content
Snippets Groups Projects
Commit 9b6c3857 authored by Chris Croome's avatar Chris Croome
Browse files

update variable for setting root auth method

parent 66a7568b
No related branches found
No related tags found
No related merge requests found
Pipeline #12630 passed
......@@ -30,22 +30,20 @@ mariadb_query_cache_size: 0
# Import time zone tables
mariadb_time_zone_import: false
# If the mariadb_root_password variable is not set then nothing will be done to
# the root account login, which, by default, uses a socket for logins and
# doesn't have a password set, generally you will want to omit this option --
# it is only for cases where non-root users need to login to MariaDB as root
# that you need to enable this
# If the mariadb_root_auth variable is not set then nothing will be done to the
# root account login, which, by default, uses a socket for logins and doesn't
# have a password set, generally you will want to omit this option -- it is
# only for cases where non-root users need to login to MariaDB as root that you
# need to enable this.
#
# If the value of mariadb_root_password is "set" and if /root/.my.cnf exists
# then mariadb_root_password will be read from the file, if the file doesn't
# exist then a new password will be generated and the mariadb_root_password
# variable will be set
#
# The mariadb_root_password will be written to the database and /root/.my.cnf
# If the value of mariadb_root_auth is "password" and if /root/.my.cnf exists
# then the MariaDB root password will be read from the file and set, if the
# file doesn't exist then a new password will be generated, set and written to
# that file.
#
# To reverse the setting of a root password set this variable to "socket"
#
# mariadb_root_password: set
# mariadb_root_auth: password
# If the mariadb_username is not set then no user account or database will be
# created
......
......@@ -48,7 +48,7 @@
- name: Conditionally include the root password tasks
include_tasks: mariadb_root.yml
when: ( mariadb_root_password is defined ) and ( mariadb_root_password | length > 0 )
when: ( mariadb_root_auth is defined ) and ( mariadb_root_auth is regex("^password|socket$") )
tags:
- mariadb
......
---
- name: Debug mariadb_root_password
debug:
var: mariadb_root_password
var: mariadb_root_auth
verbosity: 1
tags:
- mariadb
......@@ -36,13 +36,13 @@
- name: Set the MariaDB root password
include_tasks: mariadb_root_password.yml
when: ( mariadb_root_password is defined ) and ( mariadb_root_password == "set" )
when: ( mariadb_root_auth is defined ) and ( mariadb_root_auth == "password" )
tags:
- mariadb
- name: Set the MariaDB root use to use socket authentication
include_tasks: mariadb_root_socket.yml
when: ( mariadb_root_password is defined ) and ( mariadb_root_password == "socket" )
when: ( mariadb_root_auth is defined ) and ( mariadb_root_auth == "socket" )
tags:
- mariadb
...
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment