stephrobert.scaleway.select_hosts filter – Resolve a selector into inventory host names
Note
This filter plugin is part of the stephrobert.scaleway collection (version 0.7.0).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install stephrobert.scaleway.
To use it in a playbook, specify: stephrobert.scaleway.select_hosts.
Synopsis
Turns
group,nameortagsinto the list of inventory hosts it designates, so every operation accepts the same way of saying what to act on.Refuses an ambiguity rather than settling it, refuses an unknown key rather than selecting nothing, and compares names exactly.
Input
This describes the input of the filter, the value before | stephrobert.scaleway.select_hosts.
Parameter |
Comments |
|---|---|
The selector. Exactly one of |
Keyword parameters
This describes keyword parameters of the filter. These are the values key1=value1, key2=value2 and so on in the following
example: input | stephrobert.scaleway.select_hosts(key1=value1, key2=value2, ...)
Parameter |
Comments |
|---|---|
Ansible’s own |
|
Ansible’s own |
Examples
- name: Every production machine, by tag
ansible.builtin.set_fact:
cibles: >-
{{ {'tags': ['production', 'web']}
| stephrobert.scaleway.select_hosts(groups=groups, hostvars=hostvars) }}
Return Value
Key |
Description |
|---|---|
The inventory host names the selector designates, sorted. Returned: success |