万达换票券 发表于 2018-8-2 07:08:05

puppet自动化运维之service资源

  #vsftpd,启动且开机自起
  vi /etc/puppet/manifest/test.pp
  service {"vsftpd":
  ensure =>   running,
  enable =>   true;
  }
  #检查
  # /etc/init.d/vsftpd status
  vsftpd is stopped
  # chkconfig --list vsftpd
  vsftpd            0:off   1:off   2:off   3:off   4:off   5:off   6:off
  #
  # puppet agent --test -v --server master.perofu.com
  info: Caching catalog for client.perofu.com
  info: Applying configuration version '1395069819'
  notice: /Stage//Service/ensure: ensure changed 'stopped' to 'running'
  notice: Finished catalog run in 0.38 seconds
  #
  # /etc/init.d/vsftpd status
  vsftpd (pid 20118) is running...
  # chkconfig --list vsftpd
  vsftpd            0:off   1:off   2:on      3:on    4:on    5:on      6:off
  #源码
  service {"httpd":
  ensure =>   running,
  #restart => "/usr/local/apache2/bin/apachectl restart",
  hasrestart =>   "true",
  subscribe => File["/etc/httpd/httpd.conf"]
  }
页: [1]
查看完整版本: puppet自动化运维之service资源