Re: Passing parameters to Class from Dashboard

74 views
Skip to first unread message

Javier Alvarez Samayoa

unread,
Oct 26, 2012, 1:14:07 PM10/26/12
to puppet...@googlegroups.com
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.
Reply all
Reply to author
Forward
0 new messages