Update intro_patterns.rst (#77300)

Describe difference between targeting a single host using -i vs. --limit.  In particular, pointing out the behavior difference that -i will not rad inventory variables.
pull/77320/head
ee-github 3 years ago committed by GitHub
parent 94b73d66d5
commit c555ce1bd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -197,7 +197,7 @@ You can also limit the hosts you target on a particular run with the ``--limit``
Patterns and ansible-playbook flags
-----------------------------------
You can change the behavior of the patterns defined in playbooks using command-line options. For example, you can run a playbook that defines ``hosts: all`` on a single host by specifying ``-i 127.0.0.2,`` (note the trailing comma). This works even if the host you target is not defined in your inventory. You can also limit the hosts you target on a particular run with the ``--limit`` flag:
You can change the behavior of the patterns defined in playbooks using command-line options. For example, you can run a playbook that defines ``hosts: all`` on a single host by specifying ``-i 127.0.0.2,`` (note the trailing comma). This works even if the host you target is not defined in your inventory, but this method will NOT read your inventory for variables tied to this host and any variables required by the playbook will need to be specified manually at the command line. You can also limit the hosts you target on a particular run with the ``--limit`` flag, which will reference your inventory:
.. code-block:: bash

Loading…
Cancel
Save