如何使用 salt 状态设置 root 密码 [英] How to set root password using salt states
问题描述
我想为 mysql root 用户设置强密码.但是有一个蛋鸡问题.我有空服务器.我加盐.root 密码为空(安装后默认).
I want to set strong password for mysql root user. But there is a egg-hen problem. I have empty server. I salt it. The root password is empty (by default after install).
如果我使用
root:
mysql_user.present:
- name: root
- password: $ecur3h4x0r
- host: %
然后我将无法调用任何其他 mysql 状态,因为它们需要密码.但是下次我执行 highstate 时,此调用将不起作用,因为状态尝试使用空密码进行连接.
Then I would not be able to call any other mysql states because they would need the password. But the next time I do highstate this call would not work, because the state tries to connect with empty password.
推荐答案
是的,我们将添加 'default_user' 和 'default_pass' 设置,以便您可以处理这种情况.应该在 0.17.0
Yeah, we're going to add a 'default_user' and 'default_pass' setting so you can handle this situation. It should be in 0.17.0
这篇关于如何使用 salt 状态设置 root 密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!