Javier Alvarez Samayoa
2012-Oct-26 16:28 UTC
[Puppet Users] Passing parameters to Class from Dashboard
Good day to all: I''m trying to use the browser''s dashboard to pass a parameter variable to a simple class. class hello ( $file_name ) { file {"/tmp/${file_name}": owner => ''ubuntu'', group => ''ubuntu'' } } But when I run the agent update I keep getting ubuntu@db:~$ sudo puppet agent --test info: Retrieving plugin info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/facter_dot_d.rb info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppet_vardir.rb info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/root_home.rb err: Could not retrieve catalog from remote server: Error 400 on SERVER: Must pass file_name to Class[Hello] at /etc/puppetlabs/puppet/modules/hello/manifests/init.pp:1 on node db.company.com Any ideas on what I''m doing wrong? Thanks in advance. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/qu732-TrJHMJ. 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.
Javier Alvarez Samayoa
2012-Oct-26 17:14 UTC
[Puppet Users] Re: Passing parameters to Class from Dashboard
I just found the answer in another thread. In case somebody is looking to pass parameters from the dashboard to your classes you should reference those variables like this: $::foo instead of $foo which are local variables Hope it helps On Friday, October 26, 2012 10:28:11 AM UTC-6, Javier Alvarez Samayoa wrote:> > Good day to all: > > I''m trying to use the browser''s dashboard to pass a parameter variable to > a simple class. > > class hello ( $file_name ) { > file {"/tmp/${file_name}": > owner => ''ubuntu'', > group => ''ubuntu'' > } > } > > But when I run the agent update I keep getting > > ubuntu@db:~$ sudo puppet agent --test > info: Retrieving plugin > info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/facter_dot_d.rb > info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppet_vardir.rb > info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/root_home.rb > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Must pass file_name to Class[Hello] at > /etc/puppetlabs/puppet/modules/hello/manifests/init.pp:1 on node > db.company.com > > Any ideas on what I''m doing wrong? > > Thanks in advance. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/RoTsakEh9FkJ. 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.