Martin Opstad Reistadbakk
2007-Mar-30 07:58 UTC
Intended behavior of sourceselect => all [Proper]
Hi all, again. It looks like my last attempt of sending this message got cut off, at least it looks like that in the archive[1], so I''m trying again: <rerun> Luke Kanies suggested that I take this up here since his memory on the subject was a bit poor. I am trying to cat various files together into one file. According to the documentation "sourceselect => all" might do this. </rerun> From the language reference [2]: "Whether to copy all valid sources, or just the first one. Valid values are first, all.""" Giventhe following code file { "/etc/test": sourceselect => all, source => [ "puppet://puppetmaster.simula.no/files/linux/test1", "puppet://puppetmaster.simula.no/files/linux/test2" ], } /etc/test will only contain the content of the first file. Luke tested this as well with the same result. Is this the intended behavior? Is it a bug? With best regards, Martin Opstad Reistadbakk [1] http://mail.madstop.com/pipermail/puppet-users/2007-March/002074.html [2] http://www.reductivelabs.com/projects/puppet/reference/typedocs.html#file -- Martin Opstad Reistadbakk <martior@gmail.com> When I want to laugh, I''ll take Bob Saget thank you very much. _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Mar 30, 2007, at 2:58 AM, Martin Opstad Reistadbakk wrote:> /etc/test will only contain the content of the first file. Luke > tested this as well with the same result. Is this the intended > behavior? Is it a bug?I just checked the test code, and it confirmed what I expected: This parameter only affects recursion. Take the following example: /source1/file1 /source2/file2 and the following code: file { "/dest": source => ["/source-none", "/source1", "/ source2"], recurse => true } Normally, if you did a recursive copy, the first source that existed (in this case, /source1) would be recursively copied and the rest would be ignored. In this case, that would mean that /dest would only have file1 in it. With sourceselect => all, all found sources are recursively copied, with earlier sources winning out over later sources. The ''template'' function works like you expect, by concatenating the results of all arguments. The ''file'' function does not, but it could be converted so it does; I''m slightly uncomfortable with this whole method of listing lots of files, many of which don''t exist, but I know it''s a time-honored practice. -- God loved the birds and invented trees. Man loved the birds and invented cages. -- Jacques Deval --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
so this is legal? file { "foobar": ... content => template("foo", "bar"), ... } Wow. I never knew about this. Awesome! I''m going to test this later today and will update the Template docs to include this info if I see it works. Best, Adam> > The ''template'' function works like you expect, by concatenating the > results of all arguments. The ''file'' function does not, but it could > be converted so it does; I''m slightly uncomfortable with this whole > method of listing lots of files, many of which don''t exist, but I > know it''s a time-honored practice. > > -- > God loved the birds and invented trees. Man loved the birds and > invented > cages. -- Jacques Deval > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
On Mar 30, 2007, at 12:23 PM, Adam Kosmin wrote:> so this is legal? > > file { "foobar": > ... > content => template("foo", "bar"), > ... > } > > Wow. I never knew about this. Awesome! I''m going to test this later > today and will update the Template docs to include this info if I > see it > works.Should work fine; please let me know if it does not. -- Don''t tell me how hard you work. Tell me how much you get done. -- James Ling --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Martin Opstad Reistadbakk
2007-Mar-30 18:32 UTC
Re: Intended behavior of sourceselect => all [Proper]
On 3/30/07, Luke Kanies <luke@madstop.com> wrote:> > Should work fine; please let me know if it does not.Thanks a lot for your help. Looks very promising. Our old configuration system (confpar) was more or less based on concatenating files. Makes it a lot easier for us to convert some of the old rules. -- Martin Opstad Reistadbakk <martior@gmail.com> When I want to laugh, I''ll take Bob Saget thank you very much. _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users