ansible / ansible-documentation

Ansible community documentation
https://docs.ansible.com/
GNU General Public License v3.0
76 stars 448 forks source link

The ad-hoc command host pattern examples are missing the most common usage #1738

Open HouzuoGuo opened 1 month ago

HouzuoGuo commented 1 month ago

https://docs.ansible.com/ansible/latest/inventory_guide/intro_patterns.html#patterns-and-ad-hoc-commands presented a couple of examples of specifying host patterns in --limit:

ansible all -m <module> -a "<module options>" --limit "host1"

However --limit is rarely used in practice, because ansible command literally accepts the host pattern in its first argument:

usage: ansible [-h] [--version] [-v] [-b] [--become-method BECOME_METHOD] [--become-user BECOME_USER] [-K | --become-password-file BECOME_PASSWORD_FILE] [-i INVENTORY]
               ...
               [-f FORKS] [-M MODULE_PATH] [--playbook-dir BASEDIR] [--task-timeout TASK_TIMEOUT] [-a MODULE_ARGS] [-m MODULE_NAME]
               pattern <<<<<<<<<<<

Please include the far more commonly used ansible ... pattern invocation in the examples.

ansible-documentation-bot[bot] commented 1 month ago

Thanks for your Ansible docs contribution! We talk about Ansible documentation on matrix at #docs:ansible.im and on libera IRC at #ansible-docs if you ever want to join us and chat about the docs! We meet there on Tuesdays (see the Ansible calendar) and welcome additions to our weekly agenda items - scroll down to find the upcoming agenda and add a comment to put something new on that agenda.