master端报错信息:
1
2
3
4
5
6
7
|
[root@RS1 ~]
# salt -G 'roles:nginx' test.ping
[WARNING ] Key grains with value roles:nginx
env
:prod has an invalid
type
of <
type
'str'
>, a dict is required
for
this value
[WARNING ] Key grains with value roles:nginx
env
:prod has an invalid
type
of <
type
'str'
>, a dict is required
for
this value
[WARNING ] Key grains with value roles:nginx
env
:prod has an invalid
type
of <
type
'str'
>, a dict is required
for
this value
[WARNING ] Key grains with value roles:nginx
env
:prod has an invalid
type
of <
type
'str'
>, a dict is required
for
this value
minion.saltstack.com:
True
|
minion端的配置:
1
2
3
4
5
6
7
8
9
10
11
|
[root@redis01 ~]
# egrep -v '#|^$' /etc/salt/minion
master: 10.10.10.131
id
: minion.saltstack.com
mysql.host:
'10.10.10.131'
mysql.user:
'salt'
mysql.pass:
'salt'
mysql.db:
'salt'
mysql.port: 3306
grains:
roles: nginx
env
: prod
|
小结:主要是因为yaml的格式问题,之前以为是minion端的问题,后来发现是自己配置master的时候出了点格式问题,重新调整后,多半可以解决。
本文转自 冰冻vs西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/1896623,如需转载请自行联系原作者