1 [root@salt100 web]# salt-ssh 'salt01' state.highstate test=true # 使用 state.highstate 还是存在有些问题,所以不要用该函数
2 salt01:
3
4 Summary for salt01
5 -----------
6 Succeeded: 0
7 Failed: 0
8 -----------
9 Total states run: 0
10 Total run time: 0.000 ms
11 [root@salt100 web]#
12 [root@salt100 web]#
13 [root@salt100 web]# salt-ssh 'salt01' state.sls web.apache test=true # 正常使用
14 salt01:
15 ----------
16 ID: apache-install
17 Function: pkg.installed
18 Name: httpd
19 Result: True
20 Comment: All specified packages are already installed
21 Started: 10:26:46.078678
22 Duration: 896.211 ms
23 Changes:
24 ----------
25 ID: apache-install
26 Function: pkg.installed
27 Name: httpd-devel
28 Result: True
29 Comment: All specified packages are already installed
30 Started: 10:26:46.975113
31 Duration: 16.735 ms
32 Changes:
33 ----------
34 ID: apache-service
35 Function: service.running
36 Name: httpd
37 Result: None
38 Comment: Service httpd is set to start
39 Started: 10:26:46.992651
40 Duration: 306.683 ms
41 Changes:
42
43 Summary for salt01
44 ------------
45 Succeeded: 3 (unchanged=1)
46 Failed: 0
47 ------------
48 Total states run: 3
49 Total run time: 1.220 s
50 [root@salt100 web]#
51 [root@salt100 web]#
52 [root@salt100 web]# salt-ssh 'salt01' state.sls web.apache # 正常使用
53 salt01:
54 ----------
55 ID: apache-install
56 Function: pkg.installed
57 Name: httpd
58 Result: True
59 Comment: All specified packages are already installed
60 Started: 10:26:58.298577
61 Duration: 907.003 ms
62 Changes:
63 ----------
64 ID: apache-install
65 Function: pkg.installed
66 Name: httpd-devel
67 Result: True
68 Comment: All specified packages are already installed
69 Started: 10:26:59.205783
70 Duration: 16.56 ms
71 Changes:
72 ----------
73 ID: apache-service
74 Function: service.running
75 Name: httpd
76 Result: True
77 Comment: Service httpd has been enabled, and is running
78 Started: 10:26:59.223138
79 Duration: 980.719 ms
80 Changes:
81 ----------
82 httpd:
83 True
84
85 Summary for salt01
86 ------------
87 Succeeded: 3 (changed=1)
88 Failed: 0
89 ------------
90 Total states run: 3
91 Total run time: 1.904 s