As I said parameters created by dashboard is on top scope.
You can check out puppet’s doc regarding scoping.
Assuming you don’t what to rely on their dynamic lookup (which is what they recommended since the feature is retiring) In your module you can reference global variable directly with the :: prefix.
--KL
From: Rakesh K
Sent: Wednesday, August 08, 2012 1:52 AM
To:
[email protected]Cc: Kenneth Lo
Subject: Re: [Puppet Users] Re: Passing parameters for a class in Dashboard
Ok.. I understand ... I can simply include the class and assign it to my node.. but how will dashboard know which parameters refers to which class?
There could be a parameter like "ensure => present" and it could have been used in multiple classes that I have included, how will these things be taken care of?
On Tuesday, August 7, 2012 12:08:09 AM UTC+5:30, Kenneth Lo wrote:
In dashboard parameters are assigned via group.
So basically you just create a group, assign some parameters there, include some nodes and your class in it.
Parameters created via dashboard group are at the global top scope I believe.
--KL
From: Rakesh K <
[email protected]>
Reply-To: "pup
[email protected]" <
[email protected]>
Date: Mon, 6 Aug 2012 05:50:37 -0700
To: "pup
[email protected]" <
[email protected]>
Subject: [Puppet Users] Re: Passing parameters for a class in Dashboard
Or in other words , how do I make sure that following config is applied to my node through dashboard
class base1 {
package { ["rsync", "xinetd"]: ensure => present }
service { "xinetd": ensure => running }
include rsyncd
$password = generate("/usr/bin/pwgen", 8, 1)
user { "dba":
ensure => present,
comment => "DB user",
gid => "dba",
shell => "/bin/false",
require => Group["dba"],
}
group { "dba":
ensure => present,
}
file { "/backup-mysql":
ensure => directory,
mode => 0775,
owner => "dba",
group => "dba",
}
file { "/home/dba/rsyncd.secret":
content => "backup:${password}",
replace => no,
mode => 0460,
owner=> "root",
group => "dba",
require => User['dba'],
}
rsyncd::export { "backup":
path => "/backup-mysql",
chroot => true,
readonly => true,
uid => "dba",
gid => "dba",
users => "backup",
secrets => "/home/dba/rsyncd.secret",
allow => "192.168.0.0/24<
http://192.168.0.0/24>",
require => [File["/backup-mysql"], File["/home/dba/rsyncd.secret"]],
}
}
node 'pclient1.example.com<
http://pclient1.example.com>' {
include base1
}
On Monday, August 6, 2012 2:44:00 PM UTC+5:30, Rakesh K wrote:
Hi,
I have recently installed puppet and components including dashboard on my server. I am new to puppet and what I am trying to achieve here is passing parameters via dashboard
What I can see right now is under Add Class in dashboard, I can only pass the class names. Whereas when I can include classes via nodes.pp I can also pass parameters.
How can do this from dashboard,
eg. if I want to achieve the following from dashboard how will I be able to do it
/etc/puppet/manifests/nodes.pp
class baseclass {
class { 'mysql': }
class { 'mysql::server':
#config_hash => { 'root_password' => 'mypass' }
}
mysql::db { 'mydb':
user => 'myuser',
password => 'mypass',
host => 'localhost',
grant => ['all'],
}
}
node 'pclient1.example.com<
http://pclient1.example.com/>' {
include baseclass
}
And this is how my site.pp looks like
[
[email protected] ~]# cat /etc/puppet/manifests/site.pp
import 'nodes.pp'
$puppetserver = 'pmast1.example.com<
http://pmast1.example.com>'
filebucket { "main":
server => "puppet",
path => false,
}
File { backup => "main" }
Please suggest.
--
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/-/hqByM-qJEegJ.To post to this group, send email to
[email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
________________________________
No virus found in this message.
Checked by AVG - www.avg.com<
http://www.avg.com>
Version: 2012.0.2176 / Virus Database: 2437/5183 - Release Date: 08/07/12
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to
[email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.