我正在使用 SaltStack(带有 vagrant)/Ubuntu 12.04。
我的目标是安装 Mysql,创建数据库和用户并授予所有权限。
这个 SLS 文件有什么问题?
mysql_setup:
debconf.set:
- name: mysql-server
- data:
'mysql-server/root_password': {'type': 'string', 'value': '{{ pillar['database']['password'] }}'}
'mysql-server/root_password_again': {'type': 'string', 'value': '{{ pillar['database']['password'] }}'}
mysql-server:
pkg:
- installed
- require:
- debconf: mysql_setup
mysql-base:
mysql_database.present:
- name: owncloud
mysql_user.present:
- name: owncloud
- password: pass
mysql_grants.present:
- database: owncloud.*
- grant: ALL PRIVILEGES
- user: owncloud
我有这个错误:
[INFO ] All specified answers are already set
[INFO ] Completed state [mysql-server] at time 14:48:13.611204
[INFO ] Running state [mysql-server] at time 14:48:13.644547
[INFO ] Executing state pkg.installed for mysql-server
[INFO ] Package mysql-server is already installed.
[INFO ] Completed state [mysql-server] at time 14:48:13.695092
[DEBUG ] LazyLoaded mysql_database.mod_init
[INFO ] Running state [owncloud] at time 14:48:13.702359
[DEBUG ] LazyLoaded mysql_database.present
[ERROR ] State 'mysql_database.present' was not found in SLS 'mysql'
[DEBUG ] LazyLoaded mysql_user.mod_init
[INFO ] Running state [owncloud] at time 14:48:13.710744
[DEBUG ] LazyLoaded mysql_user.present
[ERROR ] State 'mysql_user.present' was not found in SLS 'mysql'
[DEBUG ] LazyLoaded mysql_grants.mod_init
[INFO ] Running state [mysql-base] at time 14:48:13.733003
[DEBUG ] LazyLoaded mysql_grants.present
[ERROR ] State 'mysql_grants.present' was not found in SLS 'mysql'