From f347133d8564935867f6771d658f25d38a209f17 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Fri, 8 Nov 2013 10:51:28 -0500 Subject: [PATCH] Revert "Move info on limit from the ad hoc command page to the pattern page" This reverts commit cda707f99e42a7c0fe1332987b2632e1fdc600a3. --- docsite/rst/intro_patterns.rst | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/docsite/rst/intro_patterns.rst b/docsite/rst/intro_patterns.rst index dc3485bb93..f46a5f5a30 100644 --- a/docsite/rst/intro_patterns.rst +++ b/docsite/rst/intro_patterns.rst @@ -73,32 +73,9 @@ Most people don't specify patterns as regular expressions, but you can. Just st ~(web|db).*\.example\.com -Limiting Selected Hosts -``````````````````````` +While we're jumping a bit ahead, additionally, you can add an exclusion criteria just by supplying the "--limit" flag to /usr/bin/ansible or /usr/bin/ansible-playbook:: -What hosts you select to manage can be additionally constrained by using the '--limit' parameter or -by using 'batch' (or 'range') selectors. - -As mentioned above, patterns can be strung together to select hosts in more than one group:: - - $ ansible webservers:dbservers -m command -a "/bin/foo xyz" - -This is an "or" condition. If you want to further constrain the selection, use --limit, which -also works with ``ansible-playbook``:: - - $ ansible webservers:dbservers -m command -a "/bin/foo xyz" --limit region - -Assuming version 0.9 or later, as with other host patterns, values to limit can be separated with ";", ":", or ",". - -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:: - - $ ansible webservers[0-99] -m command -a "/bin/foo xyz" - $ ansible webservers[100-199] -m command -a "/bin/foo xyz" - -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). - -Both of these methods can be used at the same time, and ranges can also be passed to the --limit parameter. + ansible-playbook site.yml --limit datacenter2 Easy enough. See :doc:`intro_adhoc` and then :doc:`playbooks` for how to apply this knowledge.