When you install a myql server package you typically end up with a root
user without a password.
As a way of dealing with this in a indempotent way I was thinking of
extending the mysql_user module to add a boolean option, say
fix_unpassworded_root_user, which if set:-
- throws an error if login_user is not root or login_password
is not set
- throws an error if user or password parameters are set - this only
does one thing
- attempts to authenticate with the given login_user/login_password
returns ok (unchanged) if works
- attempts to authenticate with root/empty password and returns
failed if that does not work
- sets the root password to the supplied login_password, returns
ok (changed) if works
I think it may be possible to do this with a hacked around pair of
mysql_user calls (the first ignoring failure, the second being there to
check the root password is correctly set), but I think extending the
module for this special case may make things clearer at the cost of
additional internal complexity...
Or do others disagree?
Nigel.
--
[ Nigel Metheringham ------------------------------
ni...@dotdot.it ]
[ Ellipsis Intangible Technologies ]