Hello, I am new to using the puppet dashboard. Some of my mondules require variables to be passed to them from the node. So for example. I have a networking module that needs the following passed to it: $ipaddress = ''192.168.0.2'' $gateway = ''192.168.0.1'' $hostname = ''testbox'' $nenviron = ''mgmt'' $hostname2 = ''testbox2'' Normally it would look like this in my node file: node ''myhost.mydomain.com'' { $ipaddress = ''192.168.0.2'' $gateway = ''192.168.0.1'' $hostname = ''testbox'' $nenviron = ''mgmt'' $hostname2 = ''testbox2'' } I am trying to get away from manually editing the node file and am using the puppet dashboard. So I can add my modules fine and they work if I manually edit my nodes file but if I add the node through the dashboard and set my classes I don''t see a way to specify variables. Is there anyway that I could get the same values that I would normally put into my node file into the puppet dashboard? -- 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.
all.lucky.sevens
2012-Feb-28 17:08 UTC
Re: [Puppet Users] Specify values for variables? Puppet dashboard
On a specific note, most of the variables on the example below should be available as Facter facts out of the box (hostname, IP address). On a more general node, doesn''t look like parameterized classes are directly supported in the Dashboard ENC yet: http://projects.puppetlabs.com/issues/4738 However there is a thread in this list for a workaround using a wrapper class: https://groups.google.com/group/puppet-users/browse_thread/thread/2e7708b0827c7f3e/f8bcf6d84bd07990?show_docid=f8bcf6d84bd07990 Just define your variables as parameters on the node directly or on groups (which are inherited by the node members) and they should be available as top level variables during the node compilation. For example, defining a parameter ''ipaddress'' on the node in dashboard makes the variable $::ipaddress available with the value you specified in Dashboard to be used by the wrapper class or directly in your manifests. Be careful of naming collisions with Facter and other modules since the parameters are put in the top scope. On Fri, Feb 24, 2012 at 8:38 AM, Luke <lutaylor@gmail.com> wrote:> Hello, > > I am new to using the puppet dashboard. Some of my mondules require > variables to be passed to them from the node. > > So for example. I have a networking module that needs the following > passed to it: > > $ipaddress = ''192.168.0.2'' > $gateway = ''192.168.0.1'' > $hostname = ''testbox'' > $nenviron = ''mgmt'' > $hostname2 = ''testbox2'' > > Normally it would look like this in my node file: > > node ''myhost.mydomain.com'' { > $ipaddress = ''192.168.0.2'' > $gateway = ''192.168.0.1'' > $hostname = ''testbox'' > $nenviron = ''mgmt'' > $hostname2 = ''testbox2'' > > > } > > I am trying to get away from manually editing the node file and am > using the puppet dashboard. So I can add my modules fine and they work > if I manually edit my nodes file but if I add the node through the > dashboard and set my classes I don''t see a way to specify variables. > Is there anyway that I could get the same values that I would normally > put into my node file into the puppet dashboard? > > -- > 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. >-- 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.