mr923 发表于 2018-8-1 11:15:34

SaltStack使用教程(二):文件和目录管理

# salt 'salt-minion1' state.highstate#salt '执行节点' 执行模块  
下面是执行结果
  
salt-minion1:                              #执行节点
  
----------
  
          ID: /etc/hosts                   #配置ID
  
    Function: file.managed               #模块
  
      Result: True                         #执行结果True为成功
  
   Comment: File /etc/hosts updated      #文件执行操作【更新】
  
   Started: 14:15:55.120499            #执行命令开始时间
  
    Duration: 24.284 ms                  #执行的时长
  
   Changes:                              #是否产生更改
  
            ----------
  
            diff:
  
                  ---
  
                  +++
  
                  @@ -1,2 +1,4 @@
  
                   127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
  
                   ::1         localhost localhost.localdomainlocalhost6 localhost6.localdomain
  
                  +salt-master 10.0.0.11    #在这个带有“+”号的行是增加的,"-"号为减少行
  
                  +salt-minion1 10.0.0.21
  

  
Summary
  
------------
  
Succeeded: 1 (changed=1)                  #执行成功1个,有一个文件状态发生更改
  
Failed:    0                              #执行失败0个
  
------------
  
Total states run:   1                     #执行状态个数
页: [1]
查看完整版本: SaltStack使用教程(二):文件和目录管理