Puppet Dashboard Groups

161 views
Skip to first unread message

kaustubh chaudhari

unread,
Jan 27, 2014, 9:16:09 AM1/27/14
to puppet...@googlegroups.com
Hi,

I was looking for a way to group the servers dynamically. Eg: create a "Windows" Group and all the existing nodes and new nodes should be part of "Windows" group.
I edit a group and then add each server, but practically its not possible with 2k servers in all!!

Is there a way to do that?

-Kaustubh

Stefan Heijmans

unread,
Jan 28, 2014, 4:15:39 AM1/28/14
to puppet...@googlegroups.com

>>I was looking for a way to group the servers dynamically

Don't know about this but how about making use of the provided rake tasks, like;
rake nodegroup:add                             # Add a new node group
rake nodegroup:add_all_nodes                   # Automatically adds all nodes to a group
rake node:addgroup                             # Add group(s) to a node

Stefan

Op maandag 27 januari 2014 15:16:09 UTC+1 schreef kaustubh chaudhari:

kaustubh chaudhari

unread,
Jan 28, 2014, 5:24:08 AM1/28/14
to puppet...@googlegroups.com
Thanks for the Reply Stefan!

I did looked into these options, but i dint find a way to add only windows systems to windows group and linux system to linux group.

-Kaustubh

Stefan Heijmans

unread,
Jan 28, 2014, 6:35:34 AM1/28/14
to puppet...@googlegroups.com
Do you have MCollective running?
You could use this to generate a list based on specified facts (mco find --wf <fact>) to use in those rake tasks.
Or create them by hand from the Inventory Search in the Dashboard, maybe even a custom rake task.
 
Stefan
 

Op dinsdag 28 januari 2014 11:24:08 UTC+1 schreef kaustubh chaudhari:

kaustubh chaudhari

unread,
Jan 28, 2014, 7:36:11 AM1/28/14
to puppet...@googlegroups.com
Hi Stefan,

I am in process of setting up MCollective!

In the mean while i can do the search using inventory search in Dashboard, i do get the list, but when i try ti export the details in the cvs format, it wont export only filtered, it will export all the node list ie: all linux windows etc.

where i an searching with the facts as osfamily = windows  and/or Linux.

-Kaustubh

With Warm Regards
Kaustubh.A.Chaudhari
(M)-09373102619


--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/bzFuC0l3TPk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/6d1b71cb-77c4-4884-ac7f-ff06ce70f069%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Stefan Heijmans

unread,
Jan 28, 2014, 9:44:38 AM1/28/14
to puppet...@googlegroups.com
>>it will export all the node list
That's not nice :(
So that will really be by hand; copy/paste & strip hostnames.
 
Stefan

Op dinsdag 28 januari 2014 13:36:11 UTC+1 schreef kaustubh chaudhari:

Jose Luis Ledesma

unread,
Jan 28, 2014, 12:44:29 PM1/28/14
to puppet...@googlegroups.com
What about storing the facts in yaml format in the puppetmaster and just doing a grep there?

Richard Berwald

unread,
Jan 29, 2014, 2:13:13 PM1/29/14
to puppet...@googlegroups.com
I recently faced the same challenge. I did not want to group by osfamily but by another fact.
I came up with this solution:
1) retrieve a list from PuppetDB in format 'nodename:factvalue' for all nodes using puppetdbquery on a puppetmaster (sudo puppet query facts --facts=<factname> "<some query that resolved to true>")
2) retrieve the group list from the console with 'rake nodegroup:list'
3) Compare the existing groups with the groups based upon the values from the fact and create missing groups with 'nodegroup:add[groupname]
4) For each (already) existing group, get all members of the group with 'nodegroup:group_list[groupname]'
5) Compare the nodenames that are already in the group with the list of nodenames from PuppetDB, and add missing nodes of a group with node:group[nodename,<standardgroup>:<groupname>]

I came to this solution because rake calls felt relatively slow (about 7 seconds per call) on our platform and I wanted it to be able to potentially scale to thousands of nodes.
This runs once a night from an old fashioned cron.

Richard

kaustubh chaudhari

unread,
Jan 30, 2014, 8:38:15 AM1/30/14
to puppet...@googlegroups.com
Hi,

Thanks for the reply Richard,

I will try this and share the details!

-Kaustubh
Reply all
Reply to author
Forward
0 new messages