Daniel Pittman
2010-Dec-24 04:01 UTC
[Puppet Users] puppet resource, and parameters that take arrays...
So, I had occasion to try and use the ''puppet resource'' operation for the first time, and colour me foolish but I can''t actually work it out. Specifically, I can''t figure out how to get an array of values set: ] puppet resource host some.example.com ip=127.0.0.1 host_aliases=www.example.com,mail.example.com That doesn''t work. Neither does giving the host_aliases argument multiple times, or "[www,mail]", or "[''www'',''mail'']", and I can''t identify any other approach from the docs. Now, obviously I can dive into the code, but I figured to ask if anyone else can tell me the answer without having to do that I can be happy. :) Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
William Van Hevelingen
2010-Dec-24 04:37 UTC
Re: [Puppet Users] puppet resource, and parameters that take arrays...
> > > Its helpful if you include error messages, but the answer ispuppet resource host some.example.com ip=127.0.0.1 host_aliases="['' www.example.com'',''mail.example.com'']" -- William Van Hevelingen wvan13@gmail.com -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Daniel Pittman
2010-Dec-24 04:50 UTC
Re: [Puppet Users] puppet resource, and parameters that take arrays...
On Fri, Dec 24, 2010 at 15:37, William Van Hevelingen <wvan13@gmail.com> wrote:> Its helpful if you include error messagesThere were no error messages, just incorrect behaviour, but it is a fair request. :)> but the answer is > puppet resource host some.example.com ip=127.0.0.1 > host_aliases="[''www.example.com'',''mail.example.com'']"Sorry, nope: daniel@ea:~$ puppet resource host some.example.com target=${PWD}/demo ip=127.0.0.1 host_aliases="[''www.example.com'',''mail.example.com'']" notice: /Host[some.example.com]/ensure: created host { ''some.example.com'': ip => ''127.0.0.1'', host_aliases => [''[''www.example.com'',''mail.example.com'']''], target => ''/Users/daniel/demo'', ensure => ''present'' } daniel@ea:~$ cat demo # HEADER: This file was autogenerated at Fri Dec 24 15:49:25 +1100 2010 # HEADER: by puppet. While it can still be managed manually, it # HEADER: is definitely not recommended. 127.0.0.1 some.example.com [''www.example.com'',''mail.example.com''] That would ... well, "not work" is a nice way to put it. Puppet just did as asked, but broke my hosts file in the process. If I used that live. :) Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
William Van Hevelingen
2010-Dec-24 05:04 UTC
Re: [Puppet Users] puppet resource, and parameters that take arrays...
> > Sorry, nope: >Ack my bad misread the output.> >I think its a bug, I seem to remember that the parsedfile provider doesn''t always work correctly under puppet resource <http://mail.example.com/> -- William Van Hevelingen wvan13@gmail.com -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Daniel Pittman
2010-Dec-24 06:04 UTC
Re: [Puppet Users] puppet resource, and parameters that take arrays...
On Fri, Dec 24, 2010 at 16:04, William Van Hevelingen <wvan13@gmail.com> wrote:>> Sorry, nope:[...]> Ack my bad misread the output.No problem there. I figured that this time I better actually include the "error" message though. ;)> I think its a bug, I seem to remember that the parsedfile provider doesn''t > always work correctly under puppet resourceMy impression is that it isn''t parsing the command line properly to extract the array data, but it sounds like I am going to have to dig into the code. Oh, well. :) Regards, Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.