Andreas Dvorak
2014-Jan-24 13:25 UTC
[Puppet Users] file resource to provide serveral files
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
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/c694b900-60f9-4c7c-bccd-b9c7adf6d689%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.