FAQ
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' {
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'
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/-/IIkh7layBQwJ.
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.

Search Discussions

  • Rakesh K at Aug 6, 2012 at 12:57 pm
    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",
    require => [File["/backup-mysql"], File["/home/dba/rsyncd.secret"]],
    }

    }

    node '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' {
    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'
    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.
  • Kenneth Lo at Aug 6, 2012 at 6:38 pm
    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: "[email protected] " <[email protected]
    Date: Mon, 6 Aug 2012 05:50:37 -0700
    To: "[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",
    require => [File["/backup-mysql"], File["/home/dba/rsyncd.secret"]],
    }

    }

    node '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 puppet-users+[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.

    --
    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.
  • Rakesh K at Aug 8, 2012 at 5:51 am
    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] <javascript:>>
    Reply-To: "[email protected] <javascript:>" <
    [email protected] <javascript:>>
    Date: Mon, 6 Aug 2012 05:50:37 -0700
    To: "[email protected] <javascript:>" <[email protected]<javascript:>
    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",
    require => [File["/backup-mysql"], File["/home/dba/rsyncd.secret"]],
    }

    }

    node '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' {
    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'
    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]<javascript:>
    .
    To unsubscribe from this group, send email to
    [email protected] <javascript:>.
    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.
    --
    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/-/sX2fXrzbKywJ.
    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.
  • Kenneth Lo at Aug 8, 2012 at 4:29 pm
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedAug 6, '12 at 9:14a
activeAug 8, '12 at 4:29p
posts5
users2
websitepuppetlabs.com

2 users in discussion

Rakesh K: 3 posts Kenneth Lo: 2 posts

People

Translate

site design / logo © 2023 Grokbase