mpdehaan/ansible — Issue #52: Make pattern matching more automagical in lib/runner, CLI changes in /bin/ansible
Author: mpdehaan
Created: 2012-02-29 13:14:08+00:00
State: open

My propsoal to mailing list: (re thread: http://groups.google.com/group/ansible-project/browse_thread/thread/2b6403036da0bf34)

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
- I want to be able to target hosts in a particular pattern from my inventory file
- I want to be able to target specific group(s) in my inventory file
- I want to be able to use an inventory file not in /etc/ansible because I installed ansible as non-root without IT admin's ok.
- I want to be able to be able to do hosts not in the inventory file

Proposal:

- "-p" becomes "-h" in /bin/ansible
- specifying the inventory file becomes "-i" or similar in /bin/ansible
- the default value for -h is "*", matching everything in the inventory file
- the default value for -i or whatever is /etc/ansible/hosts
- the ansible hosts file can have group headers like [webservers]
- if a pattern specified is a group name, it is used *directly* instead of as a pattern match, pulling in the whole group
- otherwise a pattern is tried as we have currently implemented (matching part fo the hosts in the file, ignoring groups)
- if a pattern fails to match anything completely, it is tried as an explicit hostname, doesn't have to be in the file
- edit README.md and manpage docs to match