Puppet dashboard web interface

80 views
Skip to first unread message

Thomas RICOU

unread,
Nov 13, 2013, 6:54:28 AM11/13/13
to puppet...@googlegroups.com
Hi

I'm kinda noobish to puppet and I can't find an answer to my question. What can I can do with the dashboard groups ? In fact I'm interested in setting a var "env" to a value in ['devel','valid','prod']. this value should be set only once when I create a new virtual machine using a puppet agent. The thing is that this machine will use a "default" node configuration which needs to know the value of the "env" var. For some reasons, I don' t want to create a node file per machine setting this param so I searched for something very easy to do so. I found the "Groups" I saw in the dashboard web interface and in which I created that "env" var but I can't figure out how to get it's value back in default.pp node file.

Am I completely wrong using these Groups?

Thanks

Tom

Jason Antman

unread,
Nov 13, 2013, 7:29:44 AM11/13/13
to puppet...@googlegroups.com
Tom,

I'm not sure I totally understand your question; I've also never used an
ENC (like dashboard) with default.pp, only with modules.

If you set a parameter called "env" on a group in Dashboard, and then
add node "foo.example.com" to that group, the parameter will available
in puppet as a top-scope/global variable, i.e. $::foo.

Is that what you were asking?

-jantman
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/d267b355-fc88-4f23-b60e-dffcb7f12de1%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Thomas RICOU

unread,
Nov 13, 2013, 8:50:56 AM11/13/13
to puppet...@googlegroups.com
Hi, I think you understood quite well my question even if  I was not so clear... ;)

Anyway, according to what you say, let's say that my (ENC) group is named 'DEVEL' and the var named 'env' is set to 'devel'. I add the node 'foo.example.com' to the 'DEVEL' group. Shouldn't the var be named '::env' instead of '::foo' ? Because when I addthe node 'bar.example.com' to that same group, the variable will be '::env' or '::bar' ?

Thx
Tom

Thomas RICOU

unread,
Nov 13, 2013, 11:40:15 AM11/13/13
to puppet...@googlegroups.com
Well, I tried, and (even in default.pp) i can access the var with $::env.

Thanks anyway.

Jason Antman

unread,
Nov 13, 2013, 2:38:51 PM11/13/13
to puppet...@googlegroups.com, ricou....@gmail.com
Oh wow. I shouldn't comment before I have my coffee. Yes you have it exactly right, if you call the parameter "env", it will show up as "$::env". I've fixed the example below.

-jantman


On 11/13/2013 08:50 AM, Thomas RICOU wrote:
Hi, I think you understood quite well my question even if  I was not so clear... ;)

Anyway, according to what you say, let's say that my (ENC) group is named 'DEVEL' and the var named 'env' is set to 'devel'. I add the node 'foo.example.com' to the 'DEVEL' group. Shouldn't the var be named '::env' instead of '::foo' ? Because when I addthe node 'bar.example.com' to that same group, the variable will be '::env' or '::bar' ?

Thx
Tom

Le mercredi 13 novembre 2013 13:29:44 UTC+1, Jason Antman a écrit :
Tom,

I'm not sure I totally understand your question; I've also never used an
ENC (like dashboard) with default.pp, only with modules.

If you set a parameter called "env" on a group in Dashboard, and then
add node "foo.example.com" to that group, the parameter will available
in puppet as a top-scope/global variable, i.e. $::env.
Reply all
Reply to author
Forward
0 new messages