On Thursday, 1 February 2018 22.49.06 CET Mike Cavedon wrote:
> I'm seeing what appears to be two different definitions of how limits work.
> There is the first one here:
>
>
http://docs.ansible.com/ansible/latest/playbooks_best_practices.html
>
> What about just the first 10, and then the next 10?:
>
> ansible-playbook -i production webservers.yml --limit boston[1:10]
> ansible-playbook -i production webservers.yml --limit boston[11:20]
This is not correct so it a documentation bug.
To make the statement correct it should be boston[0:9] and boston[10:19]
> Then there appears to be a different definition here:
>
>
http://docs.ansible.com/ansible/latest/intro_patterns.html
>
> You can select a host or subset of hosts from a group by their position.
> For example, given the following group:
>
> [webservers]
> cobweb
> webbing
> weber
>
> You can refer to hosts within the group by adding a subscript to the group
> name:
>
> webservers[0] # == cobweb
> webservers[-1] # == weber
> webservers[0:1] # == webservers[0],webservers[1]
> # == cobweb,webbing
> webservers[1:] # == webbing,weber
This is correct.
> Is it "--limit boston[1:2], or "--limit webservers[0:1]" for the first 2?
"--limit webservers[0:1]"
--
Kai Stian Olstad