Hey;
I suspected this was going to be a problem and, sure enough, it is.
Here's the scenario: puppet server 4.5: I have ~ 1200 hosts on which I
want specific files in /root/bin on all hosts. A reasonably large subset
of those should have additional files in /root/bin as part of an home-grown
application management process. To be clear, none of the files from the
'all-host' group overlap with any of the files from the 'some-hosts' group.
The all-host group is easy enough::
file { '/root/bin':
ensure => 'directory',
owner => 'root',
group => 'root',
mode => '0700',
recurse => true,
source => 'puppet:///modules/myroot/rootbin',
require => File['/root'],
}
So, that's worked for weeks now. In my company's slow migration to puppet
management, I'm finally to the point of adding some custom application
related files to /root/bin. On the surface, the some-hosts group is pretty
easy too::
file { 'webconfbin':
ensure => 'directory',
path => '/root/bin',
owner => 'root',
group => 'root',
mode => '0700',
recurse => true,
source => 'puppet:///modules/myroot/webconf',
}
As I suspected, that resulted in the bright red error message about
'resource /root/bin already declared'. The two options that I can think of
aren't particularly appetizing:
1. Add the files from some-hosts to all-hosts resulting in the app
management files being everywhere. These files, themselves, don't
represent a security issue, but it's not a very clean approach.
2. Use individual file resources. I could get away with that approach on
this one; but, when I run into a similar issue with dozens or 100s of
files, I'd hate to be specifying all those file resources.
Realizing I probably took a wrong turn in my initial design and figuring
someone else has to have had run into this problem before, I'm asking the
experts. What's the right way to have a set of files on all hosts and a
different set of files on a subset of all hosts in the same directory?
Thanks for any hints/tips/suggestions.
Doug O'Leary
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/aa0bd31a-139e-4d8c-a845-8f292fa65054%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.