"If I can define it in the hosts file it should be support by "--limit".

Disagree.  [0:5] has traditionally been for slicing, and this would be
confusing.    What the INI host file uses is not the only inventory source,
and creation of inventory records is different from slicing against them.

However, it is true that --limit accepts fnmatch patterns, which is what
the system is running.

https://docs.python.org/2/library/fnmatch.html

Do you have a place for enhancement requests?"

Yes, but don't want this one for above reasons of being ambigious with the
slicing of groups already supported.

This could still be solved by adding each thing you'd want to limit to as a
group, or specifying an fnmatch pattern that did match some of them.

--Michael








On Wed, Apr 16, 2014 at 11:40 AM, Mike Cavedon <[email protected]> wrote:

> If I can define it in the hosts file it should be support by "--limit". Do
> you have a place for enhancement requests?
>
>
> On Tuesday, April 15, 2014 5:40:04 PM UTC-4, Michael DeHaan wrote:
>
>> Yep, that's not a thing.
>>
>> The syntax above for populating inventory via patterns is not accepted
>> directly by limit.
>>
>> What it does accept with brackets are slices, such as the first four
>> servers in a group, as:
>>
>> --limt groupfoo[0:4]
>>
>>
>>
>>
>> On Tue, Apr 15, 2014 at 12:28 PM, Mike Cavedon <[email protected]> wrote:
>>
>>> I have the following hosts file.
>>>
>>> (skytap_env)[jenkins@rts-loadgen02 dxansible]$ cat hosts_file
>>> [router_hosts]
>>> rts-rr[201:203].slsin.dataxu.net
>>> rts-rr[301:303].slsin.dataxu.net
>>>
>>> The following --limit works correctly.
>>>
>>> (skytap_env)[jenkins@rts-loadgen02 dxansible]$ ansible-playbook -v -i
>>> hosts_file realtime_system_router_matcher_hosts_stop.yml --list-hosts
>>> --limit router_hosts
>>>
>>> playbook: realtime_system_router_matcher_hosts_stop.yml
>>>
>>>   play #1 (router_hosts:matcher_hosts): host count=6
>>>     rts-rr201.slsin.dataxu.net
>>>     rts-rr202.slsin.dataxu.net
>>>     rts-rr203.slsin.dataxu.net
>>>     rts-rr301.slsin.dataxu.net
>>>     rts-rr302.slsin.dataxu.net
>>>     rts-rr303.slsin.dataxu.net
>>>
>>>   play #2 (router_hosts): host count=6
>>>     rts-rr201.slsin.dataxu.net
>>>     rts-rr202.slsin.dataxu.net
>>>     rts-rr203.slsin.dataxu.net
>>>     rts-rr301.slsin.dataxu.net
>>>     rts-rr302.slsin.dataxu.net
>>>     rts-rr303.slsin.dataxu.net
>>>
>>>   play #3 (matcher_hosts): host count=0
>>>
>>> I'm expecting the following --limit to also work.
>>>
>>> (skytap_env)[jenkins@rts-loadgen02 dxansible]$ ansible-playbook -v -i
>>> hosts_file realtime_system_router_matcher_hosts_stop.yml --list-hosts
>>> --limit rts-rr[201:203].slsin.dataxu.net
>>> ERROR: provided hosts list is empty
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>>
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/ansible-project/bc0eb91a-7b60-478a-b727-
>>> fd408437bfe6%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/bc0eb91a-7b60-478a-b727-fd408437bfe6%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/f78c6954-ab49-4d8a-ae25-58f3c01afa5c%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/f78c6954-ab49-4d8a-ae25-58f3c01afa5c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzSsAmEQhgXPE02N4Jp5JANTTuRoO4yagZ7R8oe6JBFKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to