Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # site.pp
- node 'puppet-test.card.co.uk' {
- # Set-up as a CMS linux server
- class {'act::server::linux::cms':}
- }
- # Module
- puppet]# tree modules/act/
- modules/act/
- └── manifests
- ├── definitions
- │ ├── groups.pp
- │ └── users.pp
- ├── env.pp
- ├── init.pp
- ├── lug
- ├── lug.pp
- └── products.pp
- # modules/act/manifests/init.pp
- class act::server::linux {
- # Include the ACT Local User/Group manifest.
- class {'act::lug':}
- # Modify /etc/hosts.
- host {'self':
- ensure => present,
- name => $fqdn,
- host_aliases => [$hostname],
- ip => $ipaddress,
- }
- # Setup MOTD.
- file {'motd':
- ensure => file,
- path => '/etc/motd',
- mode => 0644,
- content => "Welcome to ${hostname},\na ${operatingsystem} island in the sea of ${domain}.\n",
- }
- # Install ACT Yum repo RPM
- package { 'act-repos':
- ensure => latest,
- provider => 'rpm',
- source => "http://yum.card.co.uk/act-repo/act-repos-latest.${architecture}.rpm",
- }
- # Create local users and groups.
- realize (
- Act::Lug::Groups["admins","demiadmins"],
- Act::Lug::Users["gavinw"],
- Act::Lug::Users["gavintest"],
- )
- # Configure Sudo setup.
- class { 'sudo': }
- sudo::conf { 'admins':
- priority => 10,
- content => "# ACT Admins sudo group.\n%admins ALL=(ALL) ALL\n",
- }
- # Configure NTP.
- class { "ntp":
- servers => [ '192.168.151.254' ],
- autoupdate => false,
- }
- }
- class act::server::linux::cms inherits act::server::linux {
- # Include CMS config
- file {'cmsscheme':
- ensure => file,
- path => '/tmp/cmsscheme',
- mode => 0644,
- content => "This is a CMS host\n",
- }
- class {'act::env::glassfish3':}
- }
- # modules/act/manifests/env.pp
- class act::env::java {
- # Install Java
- class {'java':
- #distribution => 'jdk',
- #version => '1.6.0_31',
- }
- }
- class act::env::glassfish3 {
- notify {'glassfish3':
- message => "Setting up Glassfish3"}
- # Create required users and groups
- realize (
- Act::Lug::Groups["glassfish"],
- )
- include act::env::java
- }
- # 'puppet agent --test'
- [root@puppet-test ~]# puppet agent --test
- notice: Ignoring --listen on onetime run
- err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Class[Act::Env::Java] is already declared; cannot redeclare at /etc/puppet/modules/act/manifests/env.pp:8 on node puppet-test.card.co.uk
- warning: Not using cache on failed catalog
- err: Could not retrieve catalog; skipping run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement