mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Document more playbook features in 0.7, docs build
This commit is contained in:
@@ -386,10 +386,12 @@ also works with <tt class="docutils literal"><span class="pre">ansible-playbook<
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Now let’s talk about range selection. Suppose you have 1000 servers in group ‘datacenter’, but only want to target one at a time. This is also easy:</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>ansible webservers<span class="o">[</span>0-100<span class="o">]</span> -m <span class="nb">command</span> -a <span class="s2">"/bin/foo xyz"</span>
|
||||
<span class="nv">$ </span>ansible webservers<span class="o">[</span>101-200<span class="o">]</span> -m <span class="nb">command</span> -a <span class="s2">"/bin/foo xyz"</span>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>ansible webservers<span class="o">[</span>0-99<span class="o">]</span> -m <span class="nb">command</span> -a <span class="s2">"/bin/foo xyz"</span>
|
||||
<span class="nv">$ </span>ansible webservers<span class="o">[</span>100-199<span class="o">]</span> -m <span class="nb">command</span> -a <span class="s2">"/bin/foo xyz"</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>This will select the first 100, then the second 100, host entries in the webservers group. (It does not matter
|
||||
what their names or IP addresses are).</p>
|
||||
<p>Both of these methods can be used at the same time, and ranges can also be passed to the –limit parameter.</p>
|
||||
<div class="admonition-see-also admonition seealso">
|
||||
<p class="first admonition-title">See also</p>
|
||||
|
||||
Reference in New Issue
Block a user