is_in_filter¶
Note
Always use the FQCN (Fully Qualified Collection Name) arista.avd.is_in_filter
when using this plugin.
Returns True
if the input hostname matches the hostname_filter.
Synopsis¶
The filter matches if any filter strings are found in the input hostname.
hostname_filter=["all"] or hostname_filter=none will match all hostnames.
Parameters¶
Argument | Type | Required | Default | Value Restrictions | Description |
---|---|---|---|---|---|
_input | string | True | None | One hostname to match with hostname_filter. | |
hostname_filter | any | True | None | Filter as a list of strings or None . |
Examples¶
---
found_all_1: "{{ 'myhostname' | arista.avd.is_in_filter(['all']) }}"
found_all_2: "{{ 'myhostname' | arista.avd.is_in_filter(none) }}"
found_1: "{{ 'myhostname' | arista.avd.is_in_filter(['my']) }}"
found_2: "{{ 'myhostname' | arista.avd.is_in_filter(['hostname']) }}"
not_found_1: "{{ 'myhostname' | arista.avd.is_in_filter(['myhost1', 'MYhostname']) }}"
Return Values¶
Name | Type | Description |
---|---|---|
_value | boolean | True if the input hostname matches the hostname_filter. Otherwise False |
Authors¶
- Arista Ansible Team (@aristanetworks)