jiay 发表于 2018-8-1 06:49:07

SaltStack使用教程(四):服务管理

# salt 'salt-minion1' state.sls apache.install-rpm  
salt-minion1:
  
----------
  
          ID: httpd
  
    Function: pkg.installed
  
      Result: True
  
   Comment: Package httpd is already installed.
  
   Started: 10:31:08.031272
  
    Duration: 684.705 ms
  
   Changes:
  
----------
  
          ID: httpd
  
    Function: file.managed
  
      Name: /etc/httpd/conf/httpd.conf
  
      Result: True
  
   Comment: File /etc/httpd/conf/httpd.conf updated
  
   Started: 10:31:08.718996
  
    Duration: 14.606 ms
  
   Changes:
  
            ----------
  
            diff:
  
                  ---
  
                  +++
  
                  @@ -1007,3 +1007,4 @@
  
                   #    ErrorLog logs/dummy-host.example.com-error_log
  
                   #    CustomLog logs/dummy-host.example.com-access_log common
  
                   #</VirtualHost>
  
                  +
  
----------
  
          ID: httpd
  
    Function: service.running
  
      Result: True
  
   Comment: Service reloaded
  
   Started: 10:31:08.770629
  
    Duration: 89.05 ms
  
   Changes:
  
            ----------
  
            httpd:
  
                  True
  

  
Summary
  
------------
  
Succeeded: 3 (changed=2)
  
Failed:    0
  
------------
  
Total states run:   3
页: [1]
查看完整版本: SaltStack使用教程(四):服务管理