Hostgroup feature

39 views
Skip to first unread message

Chris Scheller

unread,
Nov 30, 2011, 11:15:53 AM11/30/11
to salt-...@googlegroups.com
I have been working on a new feature to group minions into logical
groups. I didn't see anyway to accomplish what I wanted with the
current list, pcre, globs and grains methods. If there is another way
please let me know.

A simple use case that I have is, I run AIDE(host based IDS) that needs
to have its database updated occasionally. The hosts that I use this on
don't have a common hostname for globs, they are basically the same as
far as grains go(from what I understand of grains thus far) and I
really don't want to type them out in a list each time. So my thought
was to have a group defined with these hosts so that something like
this would hit them all:

salt --hostgroup 'aide' cmd.run 'aideinit -y'

I currently have a working implementation in my fork
https://github.com/schelcj/salt/ but am not quite sure it is the right
way to go(this is also my first time working with python.)

I currently have the groups defined in the master config in a format
like this:

hostgroups: {
        group_name: ['host1','host2','host3'],
}                                                                                                                                                                    
                                                                                                                                                                     
However I also wrote a gist for another idea I had for the config at
https://gist.github.com/1409457 that would allow me to reuse the
existing target evaluation methods and not have to push the group
definitions to all the minions.

Is this worthwhile? Am I going about this all wrong?

Thomas S Hatch

unread,
Nov 30, 2011, 12:50:25 PM11/30/11
to salt-...@googlegroups.com
I like this, there have been some requests along these lines and I think that this will address them well. Using the existing list matcher is also a great way to go. I think that there are a few things in your code that I will want to try out and verify that everything is lined up.

Thanks, this looks good!

(Sorry I have not been in IRC, I have been beyond swamped, I should make it is tonight)

- Thomas S Hatch
Reply all
Reply to author
Forward
0 new messages