【发布时间】:2015-07-28 19:08:15
【问题描述】:
我有以下状态公式:
crm01.dbperms2:
mysql_grant.present:
- grant: all privileges
- database: '*.*'
- user: tester2
- host: 10.1.0.2
当我执行 state.sls 时出现以下错误:
ID: crm01.dbperms2
Function: mysql_grants.present
Result: False
Comment: Failed to execute: "GRANT all privileges ON *.* TO tester2@10.1.0.2" (MySQL Error 1045: Access denied for user 'debian-sys-maint'@'localhost' (using password: YES))
Changes:
不过,如果我手动添加授权,之后执行 state.sls 时不会出错:
ID: crm01.dbperms1
Function: mysql_grants.present
Result: True
Comment: Grant all privileges on *.* to bup@10.1.0.2 is already present
Changes:
我不知道我做错了什么。 有没有人知道如何通过 salt-stack 正确地向 mysql 中的用户授予权限?
TIA
【问题讨论】:
标签: salt-stack