mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 18:50:21 -07:00
Minor docs restructuring
This commit is contained in:
parent
12fd193450
commit
2cafb8d221
22 changed files with 260 additions and 294 deletions
|
@ -1,5 +1,5 @@
|
|||
Patterns
|
||||
========
|
||||
The Inventory File, Patterns, and Groups
|
||||
========================================
|
||||
|
||||
How to select hosts you wish to manage
|
||||
|
||||
|
@ -10,6 +10,9 @@ How to select hosts you wish to manage
|
|||
:doc:`playbooks`
|
||||
Learning ansible's configuration management language
|
||||
|
||||
Inventory File Format
|
||||
+++++++++++++++++++++
|
||||
|
||||
Ansible works against multiple systems in your infrastructure at the
|
||||
same time. It does this by selecting portions of systems listed in Ansible's inventory file,
|
||||
which defaults to /etc/ansible/hosts, and looks like this::
|
||||
|
@ -25,45 +28,36 @@ which defaults to /etc/ansible/hosts, and looks like this::
|
|||
two.example.com
|
||||
three.example.com
|
||||
|
||||
Targetting All Systems
|
||||
``````````````````````
|
||||
|
||||
The pattern 'all' or '*' targets all systems in the inventory file.
|
||||
|
||||
Specific Hosts
|
||||
``````````````
|
||||
Selecting Targets
|
||||
+++++++++++++++++
|
||||
|
||||
It is possible to address specific hosts:
|
||||
These patterns target all hosts in the inventory file::
|
||||
|
||||
all
|
||||
*
|
||||
|
||||
It is also possible to address specific hosts::
|
||||
|
||||
one.example.com
|
||||
one.example.com:two.example.com
|
||||
|
||||
Groups
|
||||
``````
|
||||
|
||||
The following patterns address one or more groups:
|
||||
The following patterns address one or more groups, which are denoted with the bracket
|
||||
headers in the inventory file::
|
||||
|
||||
webservers
|
||||
webservers:dbservers
|
||||
|
||||
There is also a magic group 'ungrouped' which selects systems not in a group.
|
||||
|
||||
Wildcards
|
||||
`````````
|
||||
|
||||
Individual hosts, but not groups, can also be referenced using wildcards:
|
||||
|
||||
*.example.com
|
||||
*.com
|
||||
|
||||
Mixing Things Up
|
||||
````````````````
|
||||
|
||||
Specific hosts, wildcards, and groups can all be mixed in the same pattern
|
||||
It's also ok to mix wildcard patterns and groups at the same time::
|
||||
|
||||
one*.com:dbservers
|
||||
|
||||
It is not possible to target a host not in the inventory file.
|
||||
|
||||
NOTE: It is not possible to target a host not in the inventory file.
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue