Thomas Bellman wrote:
> Paul Lathrop wrote:
> 
>> While it may seem clean to you, it doesn't map very well into Puppet.
>> You can't just have a require hanging out like that in the middle of a
>> define, just for example. Here's what I'd do (again, not really
>> understanding the "key" and "keystore" here):
> [...]
>> key {
>>   "key1":
>>     key_arg1 => value,
>>     key_arg2 => value,
>>     keystore => ["default"],
>>     require => Keystore["default"];
>>   "key2":
>>     key_arg1 => value,
>>     key_arg2 => value,
>>     keystore => ["default", "secure"],
>>     require => Keystore["default", "secure"];
>> }
> 
> Haven't you just shifted around the problem?  You still have an array
> that you need to process each element of, only it is now a list of
> keystores per key, instead of a list of keys per keystore.

The actual execution is always procedural (either within a custom type 
or exec). There is no problem to iterate over all keystores _there_.

> In order to not have any array parameters, you would need to do it
> something like this:
> 
>      keystore { "default": ...; "secure": ...; }
>      key {
>       "key1-in-default": key=>"key1", store=>"default", ...;
>       "key2-in-default": key=>"key2", store=>"default", ...;
>       "key1-in-secure": key=>"key1", store=>"secure", ...;
>       "key2-in-secure": key=>"key2", store=>"secure", ...;
>      }
> 
> However, this soon gets pretty tiring, especially if you have many
> keys and keystores...


I would recommend such a notation only where you want different 
parameters for the same key in different keystores. Then I'd go for 
something like this:

key {
        "/path/to/keystores/storefile1/keyname1": param => foo;
        "/path/to/keystores/storefile1/keyname2": param => foo;
        "/path/to/keystores/storefile1/keyname3": param => foo;
        "/path/to/keystores/storefile2/keyname1": param => bar;
        "/path/to/keystores/storefile2/keyname2": param => bar;
        "/path/to/keystores/storefile2/keyname3": param => bar;
}

Where Key["/foo/bar"] denotes the key "bar" in the keystore located at 
"/foo", with an automatic dependency from Key["/foo/bar"] to 
Keystore["/foo"].



Regards, DavidS

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to