Chinaunix首页 | 论坛 | 博客
  • 博客访问: 294839
  • 博文数量: 47
  • 博客积分: 1667
  • 博客等级: 上尉
  • 技术积分: 686
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-06 16:20
文章分类

全部博文(47)

文章存档

2013年(20)

2012年(20)

2011年(7)

分类: LINUX

2012-07-26 17:10:42

[root@web1.cctvcjw.com /etc/puppet/modules/apache]# tree
.
|-- files
|   `-- httpd.conf
|-- manifests
|   |-- config.pp
|   |-- init.pp
|   |-- install.pp
|   `-- service.pp
`-- templates

[root@web1.cctvcjw.com /etc/puppet/modules/apache/manifests]# cat init.pp
class apache {
   include apache::install,apache::config,apache::service
}
[root@web1.cctvcjw.com /etc/puppet/modules/apache/manifests]# cat install.pp
class apache::install {
             package { "apache":
                  name => 'httpd',
                  ensure => 'present',  
                  before => Class['apache::config'],        
}
}
[root@web1.cctvcjw.com /etc/puppet/modules/apache/manifests]# cat config.pp
class  apache::config {
         file { "httpd.conf":
               name => '/etc/httpd/conf/httpd.conf',
               ensure => present,
               source => 'puppet:///modules/apache/httpd.conf',
               owner => www,
               mode => 0700,
               group =>www,
               require =>Class['apache::install'],
               notify => Class['apache::service'],
}

}
[root@web1.cctvcjw.com /etc/puppet/modules/apache/manifests]# cat service.pp
class apache::service {
          service { "httpd":
                ensure => running,
#                hasrestart => true,
                hasstatus => true,
                enable => true,
                require => Class['apache::config'],
               
}
}
阅读(1649) | 评论(0) | 转发(0) |
0

上一篇:perl 发信

下一篇:监控memcached

给主人留下些什么吧!~~