Skip to content

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

Open
@HouzuoGuo

Description

@HouzuoGuo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    new_contributorThis PR is the first contribution by a new community member.

    Type

    No type

    Projects

    Status

    🆕 Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions