On 07/23/2010 03:26 PM, Rob McBroom wrote:
> On Jul 23, 2010, at 3:04 PM, John T. Guthrie wrote:
>
>
>> What would be the LDAP equivalent of the following AST configuration:
>>
>> node "test" {
>> definetest::optfile {
>> "file1":
>> fname => "foo";
>> "file2":
>> fname => "bar";
>> }
>> }
>>
> So you want to list individual files to be copied around in LDAP somehow? If
> so, I think you probably want to store the list of files using the
> `puppetVar` attribute. I haven’t used it, but I imagine that’s the place for
> machine-specific data.
>
> Really though, it sounds like you need to generalize things. In most cases,
> Puppet should know what to do based on the class(es) a system belongs to and
> not it’s hostname.
>
> There are always exceptions of course. There are cases where I want Puppet to
> distribute a file to the same path with different contents. What I usually do
> there is use the hostname in the filename on the Puppetmaster (which has no
> bearing on the client). For example:
>
> file { "replicationconf":
> name => "/etc/openldap/replication.conf",
> ensure => file,
> owner => "root",
> group => "ldap",
> mode => "640",
> source =>
> "puppet://puppet/files/$environment/ldap/$hostname.replication",
> notify => Service["ldap”],
> }
>
> Although, now that I think about it, the per-host changes in that example are
> so minimal, I should probably look into using `puppetVar` and a template for
> this file.
>
>
I apologize for not being clear. I'm not so much interested in files
that get copied around in LDAP. I was trying to invent a non-trivial
example of a define. It ended up coming out *very* contrived. I'm more
interested in general techniques for instantiating defines in LDAP
nodes. I have defines that do all sorts of things; to list all of them
and ask for advice on each and every one would take more time than its
worth. Do I need to create a "wrapper" class for the define
instantiation like this:
class def_inst {
definetest::optfile {
"file1":
fname => "foo";
"file2":
fname => "bar";
}
}
And then I can use puppetClass: def_inst in LDAP?
Thanks.
John Guthrie
[email protected]
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.