Dear all,
with my class config.pp I would like to provide config file to /etc/logrotate.d.
filename: config.pp
class logrotate::config($conf_file){
case $::osfamily {
redhat:{
file { "/etc/logrotate.d/${conf_file}":
ensure => 'present',
owner => 'root',
group => 'root',
mode => '0644',
source => "puppet://${puppetmaster}/modules/logrotate/${conf_file}",
}
}
solaris:{
notice('logrotate not available')
}
default:{
fail("Unsupported platform: ${::osfamily}")
}
}
}
In the nodes.pp I have
class {'logrotate::config':
conf_file => 'test',
}
but I get the error
Duplicate declaration: Class[Logrotate::Config]
I also have this in a module
class {'logrotate::config':
conf_file => 'puppet',
}
I thought the title of the file resource is different and it should work.
As far as I know this problem can be solved by "define" or "virtual resource", but I have no idea what is a good solution.
Can you please help me?
Best regards
Andreas