I am creating a "site module" to manage multiple VM.
I used this project as a template : https://github.com/nvalentine-puppetlabs/puppet-site which is based on a convention described by Craig Dunn at: http://www.craigdunn.org/2012/05/239/
I am using Puppet 3.4.3 (Puppet Enterprise 3.2.1).
I modified the role class to include the base profile.
class site::role inherits site::role::params {
require site
notify { "site::role": }
include site::profile::base
}
class site::profile::base inherits site::profile::base::params {
require site::profile
notify { "site::profile::base": }
include site::users
package { [
'htop',
'rsync',
'openssl',
'man',
'wget',
'nano',
'lsb-release',
'tree' ]:
ensure => present,
}
}
I have added the class site::role::www to my nodes.
Everything so far worked fine. All the packages were installed.
I then tried to create a www role and a webserver profile.
class site::role::www inherits site::role::www::params {
require site::role
notify { "site::role::www": }
# perhaps all nodes at your site use this as a base?
include site::profile::webserver
}
class site::profile::webserver inherits site::profile::webserver::params {
require site::profile
notify { "site::profile::webserver": }
file { "/home/httpd/":
ensure => "directory",
}
->
class { 'apache':
serveradmin => 'dev@domain.com',
server_tokens => 'Prod'
}
->
apache::vhost { "$ipaddress":
port => '80',
docroot => '/home/httpd/exploit',
}
include apache::mod::php
}
But none of the modifications declared in the webserver profile are taken into account...
Structure of the module:
site/
|-- LICENSE
|-- Modulefile
|-- README.md
|-- manifests
| |-- init.pp
| |-- params.pp
| |-- profile
| | |-- base
| | | `-- params.pp
| | |-- base.pp
| | |-- params.pp
| | |-- webserver
| | | `-- params.pp
| | `-- webserver.pp
| |-- profile.pp
| |-- role
| | |-- params.pp
| | |-- www
| | | `-- params.pp
| | `-- www.pp
| |-- role.pp
| `-- users.pp
|-- metadata.json
`-- tests
|-- init.pp
|-- site_profile.pp
|-- site_profile_base.pp
`-- site_role.pp
Content of classes.txt on agent nodes:
root@****:/var/opt/lib/pe-puppet# cat classes.txt
pe_mcollective
site::role::www
settings
default
pe_mcollective
pe_mcollective::params
pe_mcollective::role::agent
pe_mcollective::server
pe_mcollective::server::plugins
pe_mcollective::shared_key_files
site::role::www::params
site::params
site::role::params
site::role::www
site::role
site
site::profile::base::params
site::profile::params
site::profile::base
site::profile
site::users