On Feb 10, 2007, at 8:51 AM, Juri Rischel Jensen wrote:
> Hi,
>
> I''m trying to use several sources to pick from in a remotefile
> statement:
>
> remotefile { "/etc/sudoers":
> mode => 0440,
> source => [
> "config/apps/sudo/sudoers.${host}",
> "config/apps/sudo/sudoers"
> ],
> sourceselect => first
> }
>
> But it doesn''t seem to work. I get an error like this:
>
> "File source /srv/puppet/dist/config/apps/sudo/sudoers.config/apps/
> sudo/sudoers does not e exist"
>
> It seems like puppet concatenates the two files after dumping the
> variable "${host}".
>
> Shouldn''t it possible to use multiple sources when using a defined
> remotefile...?
Puppet does not automatically handle the array like you apparently
think it does. That is, you''ve got a line like the following in your
remote_file definition:
source => ".../$source"
But $source is an array.
I''ve thought that it might be a good idea to automatically turn
strings into an array of strings when interpolating arrays into
strings, but I do not do that right now; instead, I just evaluate the
array as a string, which does concatenate them.
In other words, you can''t currently get the behaviour you''re
looking
for.
--
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.
-- (attributed to) Brian W. Kernighan (unconfirmed)
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com