According to the MariaDB documentation, new MariaDB installations now allow the root user to use both the unix_socket
and mysql_native_password
plugins. However, the password is initially made invalid. Thus, the only way to log in as root is passwordless "as long as the login is attempted from a process owned by the operating system root
user account."
My understanding is that the salt states are not run as the root user. As a result, something like this fails with authentication denied:
Set MariaDB Root Password:
mysql_user.present:
- name: root
- password: {{ root_mariadb_password }}
- connection_user: root
- connection_host: 127.0.0.1
- connection_password: ''
- connection_charset: utf8
What is the proper way to set the root password with Salt, keeping these restrictions in mind?