rhces 发表于 2018-8-2 10:52:38

puppet管理nginx

manifests]# cat conf.pp  class nginx::conf {
  define nginx::vhost($port,$hostname,$rootdir,$filename=$title){
  file {"/etc/nginx/conf.d":
  ensure => directory,
  owner => "root",
  group => "root",
  mode => "744",
  recurse => true,

  require =>>  }
  file {"$filename":
  owner => "root",
  group => "root",
  mode => "644",
  path => "/etc/nginx/conf.d/${filename}",
  content => template("nginx/vhost.erb"),
  require => File["/etc/nginx/conf.d"],
  }
  }
  nginx::vhost{"
页: [1]
查看完整版本: puppet管理nginx