Ok, let’s review all the things we want to make possible and then we
can come up with a syntax for resolving the combinations
- I want to be able to have groups of systems
Isn’t groups of systems implicit within the hostlists? If you have a
different group just specify a different hostlist?
It does that, yes, though I can also implement groups in about 5 lines of code, so
I’m going ahead and allowing it
[webservers]
192.168.1.1
[dbservers]
192.168.1.2
dbserver.example.com
etc
FWIW, I think this is more or less what Adrian (I think) added when he did groups in Func.
Eventually I want these to be manipulatable via another script like ansible-hosts or something, but that’s total extra stuff so it can come later.
Think about “I have this pattern, what does it match” and wanting to look in advance, wanting to easily put a system in multiple groups, list the group it is in, remove a system, etc.
Keeping it simple to start with.
I suspect 95% of users will just have one inventory / host list file.
okay. So you want multiple groups at a time. - not just multiple
hostlists. Gotcha.
yep yep!
why not just do a separate groups file so you don’t have to start
parsing the hostlists in a special way.
sounds like extra work and I like everything in one file.
Plus parsing is crazy simple.
- if a pattern specified is a group name, it is used directly
instead of as a pattern match
- otherwise a pattern is tried as we have currently implemented
- if a pattern fails to match anything completely, it is tried as an
explicit hostname
I think this could be easily workable and intuitive. Sound good?
sure. One addition:
If you’re going to have patterns - might as well add negation patterns.
so I can do things like:
pattern=*.fedoraproject.org;
That would be easy to do.
I’ll accept a pull request for that once I get the basics in. Probably hammering this out tonight so it can be done and we can stop moving options around.
as we build up users they will eventually be confused if they shift too much, but I think it’s totally fair in the first week of the project