I have been using the Dashboard facility for assigning string values to keys with great glee. It solves a number of support issues that I was dealing with in a very neat fashion. I did a google search on "puppet dashboard arrays" and found that there had been some discussion about this and a feature request made but I didn''t get the impression that there was ever a resolution. Is there a way of encoding $domains = { "domain.tld" => { users => [ "tom" , "dick" , "harry" , "sally" }, "otherdomain.tld" => { users=> [ "spot", "jane", "dick"] } } from dashboard and if so how? -- Peter L. Berghold Owner, Shark River Technical Solutions LLC -- 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.
On Wed, Mar 7, 2012 at 7:53 AM, Peter Berghold <salty.cowdawg@gmail.com> wrote:> I have been using the Dashboard facility for assigning string values to keys > with great glee. It solves a number of support issues that I was dealing > with in a very neat fashion. > > I did a google search on "puppet dashboard arrays" and found that there had > been some discussion about this and a feature request made but I didn''t get > the impression that there was ever a resolution. > > Is there a way of encoding > > $domains = { "domain.tld" => { users => [ "tom" , "dick" , "harry" , > "sally" }, > "otherdomain.tld" => { users=> [ "spot", "jane", > "dick"] } > } > > from dashboard and if so how?Since dashboard only handles string, the only way I can think of is to represent the array/hash data as yaml or json in dashboard and convert the string back using a puppet function such as parsejson/parseyaml in stdlib. At the moment, there''s also additional escape characters that''s needs to be dealt with (a bug I think), so "[\"foo\"]" is returned as "[\\\"foo\\\"]". Thanks, Nan -- 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.
Peter Berghold
2012-Mar-07 16:44 UTC
Re: [Puppet Users] Puppet Dashboard, arrays and hashes
OK: that was the impression I was under after reading everything that was posted to the feature request for this... -- Peter L. Berghold Owner, Shark River Technical Solutions LLC -- 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.
On Wed, Mar 7, 2012 at 8:44 AM, Peter Berghold <salty.cowdawg@gmail.com> wrote:> OK: that was the impression I was under after reading everything that was > posted to the feature request for this...Actually, I''ve mistakenly filed it as a bug. If you use json, you can parse the parameter via parsejson available in stdlib: In dashboard set the parameter example to ["foo", "bar"] ENC output: parameters: example: "[\"foo\", \"bar\"]" In puppet manifests: $example_array = parsejson($example) notify { $example_array : } notice: /Stage[main]//Node[sample]/Notify[bar]/message: current_value absent, should be bar (noop) notice: /Stage[main]//Node[sample]/Notify[foo]/message: current_value absent, should be foo (noop) Thanks, Nan -- 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.
Pablo Fernandez
2012-Mar-14 11:30 UTC
Re: [Puppet Users] Puppet Dashboard, arrays and hashes
Hi, I am actually interested in this... what is the actual status? I would like to be able to have arrays and define them in the dashboard, possibly filling parts of the array from different groups. Is it possible? How? Thanks! BR/Pablo On Miércoles, 7 de Marzo de 2012 23:22:09 Nan Liu escribió:> On Wed, Mar 7, 2012 at 8:44 AM, Peter Berghold <salty.cowdawg@gmail.com>wrote:> > OK: that was the impression I was under after reading everything that > > was posted to the feature request for this... > > Actually, I''ve mistakenly filed it as a bug. If you use json, you can > parse the parameter via parsejson available in stdlib: > > In dashboard set the parameter example to ["foo", "bar"] > > ENC output: > parameters: > example: "[\"foo\", \"bar\"]" > > In puppet manifests: > $example_array = parsejson($example) > notify { $example_array : } > > notice: /Stage[main]//Node[sample]/Notify[bar]/message: current_value > absent, should be bar (noop) > notice: /Stage[main]//Node[sample]/Notify[foo]/message: current_value > absent, should be foo (noop) > > Thanks, > > Nan-- 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.