|
[iyunv@salt-master ~]# vim /etc/salt/master # 注释取消,定义路径
file_roots:
base:
- /srv/salt
[iyunv@salt-master ~]# vim /srv/salt/top.sls # 编写top.sls,入口文件
base:
'web:nginx':
- match: grain
- apache
[iyunv@salt-master ~]# salt '*' state.highstate # 执行命令,
salt-minion02:
----------
ID: states
Function: no.None
Result: False
Comment: No Top file or external nodes data matches found. # 未匹配上,不执行
Changes:
Summary for salt-minion02
------------
Succeeded: 0
Failed: 1
------------
Total states run: 1
Total run time: 0.000 ms
salt-master:
----------
ID: states
Function: no.None
Result: False
Comment: No Top file or external nodes data matches found. # 未匹配上,不执行
Changes:
Summary for salt-master
------------
Succeeded: 0
Failed: 1
------------
Total states run: 1
Total run time: 0.000 ms
salt-minion01:
----------
ID: apache-install
Function: pkg.installed
Name: httpd
Result: True
Comment: Package httpd is already installed # 匹配上,执行
Started: 08:38:12.103078
Duration: 713.789 ms
Changes:
----------
ID: apache-install
Function: pkg.installed
Name: httpd-devel
Result: True
Comment: Package httpd-devel is already installed
Started: 08:38:12.817233
Duration: 0.892 ms
Changes:
----------
ID: apache-service
Function: service.running
Name: httpd
Result: True
Comment: The service httpd is already running
Started: 08:38:12.819143
Duration: 39.472 ms
Changes:
Summary for salt-minion01
------------
Succeeded: 3
Failed: 0
------------
Total states run: 3
Total run time: 754.153 ms
ERROR: Minions returned with non-zero exit code
|
|
|