mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-24 21:14:00 -07:00
Feature/add ansible play hosts all (#17498)
* refactor ignore_limits_and_restrictions into ignore_limits and ignore_limitations * add ansible_play_hosts_all * update docs re ansible_play_hosts_all * only use play.hosts when is has a value * replace ansible_play_hosts with ansible_play_hosts_all * remove unnecessary var
This commit is contained in:
parent
52bf021904
commit
4650d8910e
5 changed files with 24 additions and 27 deletions
|
|
@ -224,7 +224,7 @@ This approach is similar to applying a conditional to a task such as::
|
|||
.. note::
|
||||
When used together with "serial", tasks marked as "run_once" will be run on one host in *each* serial batch.
|
||||
If it's crucial that the task is run only once regardless of "serial" mode, use
|
||||
:code:`inventory_hostname == my_group_name[0]` construct.
|
||||
:code:`when: inventory_hostname == ansible_play_hosts[0]` construct.
|
||||
|
||||
.. _local_playbooks:
|
||||
|
||||
|
|
|
|||
|
|
@ -674,6 +674,7 @@ reasons. If you have a long FQDN, ``inventory_hostname_short`` also contains th
|
|||
period, without the rest of the domain.
|
||||
|
||||
``play_hosts`` is available as a list of hostnames that are in scope for the current play. This may be useful for filling out templates with multiple hostnames or for injecting the list into the rules for a load balancer.
|
||||
``ansible_play_hosts`` is the same as ``play_hosts`` but includes all hosts in all ``serial`` batches, if you're not using ``serial`` it's the same as ``play_hosts``.
|
||||
|
||||
Don't worry about any of this unless you think you need it. You'll know when you do.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue