Enable ansible-lint for utils and fix ansible-lint issue (#278)
* Fix ansible-lint issue for utils * fix ansible-lint * Fix ansible-lint * Fix ansible-lint * Fix integration testpull/282/head
parent
c0e094637f
commit
6adf947ed8
|
@ -12,6 +12,8 @@ on: # yamllint disable-line rule:truthy
|
||||||
- cron: '0 0 * * *'
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
ansible-lint:
|
||||||
|
uses: ansible-network/github_actions/.github/workflows/ansible-lint.yml@main
|
||||||
changelog:
|
changelog:
|
||||||
uses: ansible-network/github_actions/.github/workflows/changelog.yml@main
|
uses: ansible-network/github_actions/.github/workflows/changelog.yml@main
|
||||||
integration:
|
integration:
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
dictionaryDefinitions:
|
dictionaryDefinitions:
|
||||||
- name: words
|
- name: words
|
||||||
path: .config/dictionary.txt
|
path: .config/dictionary.txt
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: "validate argspec {{ parser }}"
|
- name: "Validate argspec {{ parser }}"
|
||||||
ansible.utils.cli_parse:
|
ansible.utils.cli_parse:
|
||||||
text: ""
|
text: ""
|
||||||
parser:
|
parser:
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
vars:
|
vars:
|
||||||
msg: "parameters are mutually exclusive: command|template_path found in parser"
|
msg: "parameters are mutually exclusive: command|template_path found in parser"
|
||||||
|
|
||||||
- name: "validate argspec {{ parser }}"
|
- name: "Validate argspec {{ parser }}"
|
||||||
ansible.utils.cli_parse:
|
ansible.utils.cli_parse:
|
||||||
text: ""
|
text: ""
|
||||||
command: ls
|
command: ls
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
vars:
|
vars:
|
||||||
msg: "parameters are mutually exclusive: command|text"
|
msg: "parameters are mutually exclusive: command|text"
|
||||||
|
|
||||||
- name: "validate argspec {{ parser }}"
|
- name: "Validate argspec {{ parser }}"
|
||||||
ansible.utils.cli_parse:
|
ansible.utils.cli_parse:
|
||||||
parser:
|
parser:
|
||||||
name: ansible.netcommon.json
|
name: ansible.netcommon.json
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
vars:
|
vars:
|
||||||
msg: "one of the following is required: command, text"
|
msg: "one of the following is required: command, text"
|
||||||
|
|
||||||
- name: "validate argspec {{ parser }}"
|
- name: "Validate argspec {{ parser }}"
|
||||||
ansible.utils.cli_parse:
|
ansible.utils.cli_parse:
|
||||||
text: ""
|
text: ""
|
||||||
parser:
|
parser:
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
tags:
|
tags:
|
||||||
- xml
|
- xml
|
||||||
|
|
||||||
- name: debug os
|
- name: Debug os
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "{{ os }}"
|
msg: "{{ os }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: set fact
|
- name: Set fact
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
nxos_textfsm_text_parsed: "{{ lookup('ansible.builtin.file', '{{ role_path }}/output/nxos_show_version_textfsm_parsed.json') | from_json }}"
|
nxos_textfsm_text_parsed: "{{ lookup('ansible.builtin.file', '{{ role_path }}/output/nxos_show_version_textfsm_parsed.json') | from_json }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: set fact
|
- name: Set fact
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
nxos_ttp_text_parsed: "{{ lookup('ansible.builtin.file', '{{ role_path }}/output/nxos_show_interface_ttp_parsed.json') | from_json }}"
|
nxos_ttp_text_parsed: "{{ lookup('ansible.builtin.file', '{{ role_path }}/output/nxos_show_interface_ttp_parsed.json') | from_json }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: set fact
|
- name: Set fact
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
nxos_xml_text_parsed: "{{ lookup('ansible.builtin.file', '{{ role_path }}/output/nxos_show_interface_xml_parsed.json') | from_json }}"
|
nxos_xml_text_parsed: "{{ lookup('ansible.builtin.file', '{{ role_path }}/output/nxos_show_interface_xml_parsed.json') | from_json }}"
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
data: '<netconf-state xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">'
|
data: '<netconf-state xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">'
|
||||||
|
|
||||||
- name: validate input xml
|
- name: Validate input xml
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
_result: "{{ data|ansible.utils.from_xml() }}"
|
_result: "{{ data|ansible.utils.from_xml() }}"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
|
@ -45,13 +45,10 @@
|
||||||
|
|
||||||
- name: Retrieve the value of each path from vars
|
- name: Retrieve the value of each path from vars
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "The value of path {{ path }} in vars is {{ value }}"
|
msg: "The value of path {{ path }} in vars is {{ lookup('ansible.utils.get_path', hostvars[inventory_hostname], path) }}"
|
||||||
loop: "{{ paths.keys()|list }}"
|
loop: "{{ paths.keys()|list }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item }}"
|
loop_var: path
|
||||||
vars:
|
|
||||||
path: "{{ item }}"
|
|
||||||
value: "{{ lookup('ansible.utils.get_path', hostvars[inventory_hostname], item) }}"
|
|
||||||
# TASK [Get the paths for the object] *******************************
|
# TASK [Get the paths for the object] *******************************
|
||||||
# ok: [nxos101] => changed=false
|
# ok: [nxos101] => changed=false
|
||||||
# ansible_facts:
|
# ansible_facts:
|
||||||
|
|
|
@ -218,25 +218,27 @@
|
||||||
index: 3
|
index: 3
|
||||||
index: 3
|
index: 3
|
||||||
|
|
||||||
|
- name: Set fact
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
int_idx: |
|
||||||
|
"{{ lookup('ansible.utils.index_of',
|
||||||
|
data.interfaces.interface,
|
||||||
|
'eq', 'loopback1111', 'name') }}"
|
||||||
|
|
||||||
|
- name: Set fact
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
subint_idx: |
|
||||||
|
"{{ lookup('ansible.utils.index_of',
|
||||||
|
data.interfaces.interface[int_idx|int].subinterfaces.subinterface,
|
||||||
|
'eq', 10, 'index') }}"
|
||||||
|
|
||||||
- name: Find the description of loopback111, subinterface index 10
|
- name: Find the description of loopback111, subinterface index 10
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: |-
|
msg: |-
|
||||||
{{ data.interfaces.interface[int_idx|int]
|
{{ data.interfaces.interface[int_idx|int]
|
||||||
.subinterfaces.subinterface[subint_idx|int]
|
.subinterfaces.subinterface[subint_idx|int]
|
||||||
.config.description }}
|
.config.description }}
|
||||||
vars:
|
|
||||||
# the values to search for
|
|
||||||
int_name: loopback1111
|
|
||||||
sub_index: 10
|
|
||||||
# retrieve the index in each nested list
|
# retrieve the index in each nested list
|
||||||
int_idx: |
|
|
||||||
{{ lookup('ansible.utils.index_of',
|
|
||||||
data.interfaces.interface,
|
|
||||||
'eq', int_name, 'name') }}
|
|
||||||
subint_idx: |
|
|
||||||
{{ lookup('ansible.utils.index_of',
|
|
||||||
data.interfaces.interface[int_idx|int].subinterfaces.subinterface,
|
|
||||||
'eq', sub_index, 'index') }}
|
|
||||||
|
|
||||||
# TASK [Find the description of loopback111, subinterface index 10] ************
|
# TASK [Find the description of loopback111, subinterface index 10] ************
|
||||||
# ok: [sw01] =>
|
# ok: [sw01] =>
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
---
|
---
|
||||||
- name: cidr_merge with merge action
|
- name: Cidr_merge with merge action
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
value:
|
value:
|
||||||
- 192.168.0.0/17
|
- 192.168.0.0/17
|
||||||
- 192.168.128.0/17
|
- 192.168.128.0/17
|
||||||
- 192.168.128.1
|
- 192.168.128.1
|
||||||
|
|
||||||
- name: cidr_merge with merge action
|
- name: Cidr_merge with merge action
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ value|ansible.utils.cidr_merge }}"
|
result1: "{{ value|ansible.utils.cidr_merge }}"
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == cidr_result1 }}"
|
that: "{{ result1 == cidr_result1 }}"
|
||||||
|
|
||||||
- name: cidr_merge with span action
|
- name: Cidr_merge with span action
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
value:
|
value:
|
||||||
- 192.168.1.1
|
- 192.168.1.1
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
- 192.168.1.3
|
- 192.168.1.3
|
||||||
- 192.168.1.4
|
- 192.168.1.4
|
||||||
|
|
||||||
- name: cidr_merge with span action
|
- name: Cidr_merge with span action
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result2: "{{ value|ansible.utils.cidr_merge('span') }}"
|
result2: "{{ value|ansible.utils.cidr_merge('span') }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: hwaddr filter test1
|
- name: Hwaddr filter test1
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '1a:2b:3c:4d:5e:6f'|ansible.utils.hwaddr }}"
|
result1: "{{ '1a:2b:3c:4d:5e:6f'|ansible.utils.hwaddr }}"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == '1a:2b:3c:4d:5e:6f' }}"
|
that: "{{ result1 == '1a:2b:3c:4d:5e:6f' }}"
|
||||||
|
|
||||||
- name: hwaddr filter test2
|
- name: Hwaddr filter test2
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '1a:2b:3c:4d:5e:6f'|ansible.utils.hwaddr('cisco') }}"
|
result1: "{{ '1a:2b:3c:4d:5e:6f'|ansible.utils.hwaddr('cisco') }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: ip4_hex without delimiter
|
- name: Ip4_hex without delimiter
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '192.168.1.5'|ansible.utils.ip4_hex }}"
|
result1: "{{ '192.168.1.5'|ansible.utils.ip4_hex }}"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == 'c0a80105' }}"
|
that: "{{ result1 == 'c0a80105' }}"
|
||||||
|
|
||||||
- name: ip4_hex with delimiter
|
- name: Ip4_hex with delimiter
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '192.168.1.5'|ansible.utils.ip4_hex(':') }}"
|
result1: "{{ '192.168.1.5'|ansible.utils.ip4_hex(':') }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: set ipaddress list
|
- name: Set ipaddress list
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
value:
|
value:
|
||||||
- 192.24.2.1
|
- 192.24.2.1
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
- "42540766412265424405338506004571095040/64"
|
- "42540766412265424405338506004571095040/64"
|
||||||
- true
|
- true
|
||||||
|
|
||||||
- name: ipaddr filter with empty string query
|
- name: Ipaddr filter with empty string query
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ value|ansible.utils.ipaddr }}"
|
result1: "{{ value|ansible.utils.ipaddr }}"
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == ipaddr_result1 }}"
|
that: "{{ result1 == ipaddr_result1 }}"
|
||||||
|
|
||||||
- name: ipaddr filter with host string query
|
- name: Ipaddr filter with host string query
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result2: "{{ value|ansible.utils.ipaddr('host') }}"
|
result2: "{{ value|ansible.utils.ipaddr('host') }}"
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result2 == ipaddr_result2 }}"
|
that: "{{ result2 == ipaddr_result2 }}"
|
||||||
|
|
||||||
- name: ipaddr filter with public network query
|
- name: Ipaddr filter with public network query
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result3: "{{ value|ansible.utils.ipaddr('public') }}"
|
result3: "{{ value|ansible.utils.ipaddr('public') }}"
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result3== ipaddr_result3 }}"
|
that: "{{ result3== ipaddr_result3 }}"
|
||||||
|
|
||||||
- name: ipaddr filter with network query
|
- name: Ipaddr filter with network query
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result4: "{{ value|ansible.utils.ipaddr('net') }}"
|
result4: "{{ value|ansible.utils.ipaddr('net') }}"
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result4 == ipaddr_result4 }}"
|
that: "{{ result4 == ipaddr_result4 }}"
|
||||||
|
|
||||||
- name: ipaddr filter with network/prefix query
|
- name: Ipaddr filter with network/prefix query
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result5: "{{ '192.168.0.0/23' | ansible.utils.ipaddr('network/prefix') }}"
|
result5: "{{ '192.168.0.0/23' | ansible.utils.ipaddr('network/prefix') }}"
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result5 == '192.168.0.0/23' }}"
|
that: "{{ result5 == '192.168.0.0/23' }}"
|
||||||
|
|
||||||
- name: ipaddr filter with chained filters
|
- name: Ipaddr filter with chained filters
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result6: "{{ '192.168.255.0' | ansible.utils.ipaddr('network') | ansible.utils.ipmath(123) }}"
|
result6: "{{ '192.168.255.0' | ansible.utils.ipaddr('network') | ansible.utils.ipmath(123) }}"
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "Test int input for ipaddr filter"
|
msg: "Test int input for ipaddr filter"
|
||||||
|
|
||||||
- name: set fact 1
|
- name: Set fact 1
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
ip1: "172.20.0.1"
|
ip1: "172.20.0.1"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: convert address to subnet using ipsubnet
|
- name: Convert address to subnet using ipsubnet
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ address | ansible.utils.ipsubnet }}"
|
result1: "{{ address | ansible.utils.ipsubnet }}"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == '192.168.144.5/32' }}"
|
that: "{{ result1 == '192.168.144.5/32' }}"
|
||||||
|
|
||||||
- name: check if given value is subnet
|
- name: Check if given value is subnet
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result2: "{{ subnet | ansible.utils.ipsubnet }}"
|
result2: "{{ subnet | ansible.utils.ipsubnet }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: set ipaddress list
|
- name: Set ipaddress list
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
value:
|
value:
|
||||||
- 192.24.2.1
|
- 192.24.2.1
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
- "42540766412265424405338506004571095040/64"
|
- "42540766412265424405338506004571095040/64"
|
||||||
- true
|
- true
|
||||||
|
|
||||||
- name: ipv4 filter
|
- name: Ipv4 filter
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ value|ansible.utils.ipv4 }}"
|
result1: "{{ value|ansible.utils.ipv4 }}"
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == result1_val }}"
|
that: "{{ result1 == result1_val }}"
|
||||||
|
|
||||||
- name: convert ipv4 to ipv6 filter
|
- name: Convert ipv4 to ipv6 filter
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result2: "{{ value|ansible.utils.ipv4('ipv6') }}"
|
result2: "{{ value|ansible.utils.ipv4('ipv6') }}"
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result3 == result3_val }}"
|
that: "{{ result3 == result3_val }}"
|
||||||
|
|
||||||
- name: ipv4 filter with single value
|
- name: Ipv4 filter with single value
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result4: "{{ '192.24.2.1' | ansible.utils.ipv4('ipv6') }}"
|
result4: "{{ '192.24.2.1' | ansible.utils.ipv4('ipv6') }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: set ipaddress list
|
- name: Set ipaddress list
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
value:
|
value:
|
||||||
- 192.24.2.1
|
- 192.24.2.1
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
- fe80::100/10
|
- fe80::100/10
|
||||||
- true
|
- true
|
||||||
|
|
||||||
- name: ipv6 filter
|
- name: Ipv6 filter
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ value|ansible.utils.ipv6 }}"
|
result1: "{{ value|ansible.utils.ipv6 }}"
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == ipv6_result1 }}"
|
that: "{{ result1 == ipv6_result1 }}"
|
||||||
|
|
||||||
- name: convert ipv6 to ipv4 filter
|
- name: Convert ipv6 to ipv4 filter
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result2: "{{ value|ansible.utils.ipv6('ipv4') }}"
|
result2: "{{ value|ansible.utils.ipv6('ipv4') }}"
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result3 == ipv6_result3 }}"
|
that: "{{ result3 == ipv6_result3 }}"
|
||||||
|
|
||||||
- name: ipv6 filter with single value
|
- name: Ipv6 filter with single value
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result4: "{{ '::ffff:192.168.32.0/120' | ansible.utils.ipv6('ipv4') }}"
|
result4: "{{ '::ffff:192.168.32.0/120' | ansible.utils.ipv6('ipv4') }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: set ipaddress list
|
- name: Set ipaddress list
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
value:
|
value:
|
||||||
- 192.24.2.1
|
- 192.24.2.1
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
- "42540766412265424405338506004571095040/64"
|
- "42540766412265424405338506004571095040/64"
|
||||||
- true
|
- true
|
||||||
|
|
||||||
- name: ipwrap filter
|
- name: Ipwrap filter
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ value|ansible.utils.ipwrap }}"
|
result1: "{{ value|ansible.utils.ipwrap }}"
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == ipwrap_result1 }}"
|
that: "{{ result1 == ipwrap_result1 }}"
|
||||||
|
|
||||||
- name: ipwrap filter with single value
|
- name: Ipwrap filter with single value
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result4: "{{ 'fe80::100/10' | ansible.utils.ipwrap }}"
|
result4: "{{ 'fe80::100/10' | ansible.utils.ipwrap }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: macaddr filter test1
|
- name: Macaddr filter test1
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '1a:2b:3c:4d:5e:6f'|ansible.utils.macaddr }}"
|
result1: "{{ '1a:2b:3c:4d:5e:6f'|ansible.utils.macaddr }}"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == '1a:2b:3c:4d:5e:6f' }}"
|
that: "{{ result1 == '1a:2b:3c:4d:5e:6f' }}"
|
||||||
|
|
||||||
- name: macaddr filter test2
|
- name: Macaddr filter test2
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '1a:2b:3c:4d:5e:6f'|ansible.utils.macaddr('cisco') }}"
|
result1: "{{ '1a:2b:3c:4d:5e:6f'|ansible.utils.macaddr('cisco') }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: network_in_network filter test1
|
- name: Network_in_network filter test1
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '192.168.0.0/24'|ansible.utils.network_in_network('192.168.0.1') }}"
|
result1: "{{ '192.168.0.0/24'|ansible.utils.network_in_network('192.168.0.1') }}"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == true }}"
|
that: "{{ result1 == true }}"
|
||||||
|
|
||||||
- name: network_in_network filter test2
|
- name: Network_in_network filter test2
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '192.168.0.0/24'|ansible.utils.network_in_network('10.0.0.1') }}"
|
result1: "{{ '192.168.0.0/24'|ansible.utils.network_in_network('10.0.0.1') }}"
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == False }}"
|
that: "{{ result1 == False }}"
|
||||||
|
|
||||||
- name: network_in_network filter test3
|
- name: Network_in_network filter test3
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '192.168.0.0/16'|ansible.utils.network_in_network('192.168.0.0/24') }}"
|
result1: "{{ '192.168.0.0/16'|ansible.utils.network_in_network('192.168.0.0/24') }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: network_in_usable filter test1
|
- name: Network_in_usable filter test1
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '192.168.0.0/24'|ansible.utils.network_in_usable('192.168.0.1') }}"
|
result1: "{{ '192.168.0.0/24'|ansible.utils.network_in_usable('192.168.0.1') }}"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == true }}"
|
that: "{{ result1 == true }}"
|
||||||
|
|
||||||
- name: network_in_usable filter test2
|
- name: Network_in_usable filter test2
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '192.168.0.0/24'|ansible.utils.network_in_usable('192.168.0.255') }}"
|
result1: "{{ '192.168.0.0/24'|ansible.utils.network_in_usable('192.168.0.255') }}"
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == False }}"
|
that: "{{ result1 == False }}"
|
||||||
|
|
||||||
- name: network_in_usable filter test3
|
- name: Network_in_usable filter test3
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '192.168.0.0/16'|ansible.utils.network_in_usable('192.168.0.255') }}"
|
result1: "{{ '192.168.0.0/16'|ansible.utils.network_in_usable('192.168.0.255') }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: next_nth_usable filter
|
- name: Next_nth_usable filter
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '192.168.122.1/24'|ansible.utils.next_nth_usable(2) }}"
|
result1: "{{ '192.168.122.1/24'|ansible.utils.next_nth_usable(2) }}"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == '192.168.122.3' }}"
|
that: "{{ result1 == '192.168.122.3' }}"
|
||||||
|
|
||||||
- name: next_nth_usable filter
|
- name: Next_nth_usable filter
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '192.168.122.254/24'|ansible.utils.next_nth_usable(2) }}"
|
result1: "{{ '192.168.122.254/24'|ansible.utils.next_nth_usable(2) }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: nthhost filter test1
|
- name: Nthhost filter test1
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '10.0.0.0/8'|ansible.utils.nthhost(305) }}"
|
result1: "{{ '10.0.0.0/8'|ansible.utils.nthhost(305) }}"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == '10.0.1.49' }}"
|
that: "{{ result1 == '10.0.1.49' }}"
|
||||||
|
|
||||||
- name: nthhost filter test2
|
- name: Nthhost filter test2
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '10.0.0.0/8'|ansible.utils.nthhost(-1) }}"
|
result1: "{{ '10.0.0.0/8'|ansible.utils.nthhost(-1) }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: previous_nth_usable filter
|
- name: Previous_nth_usable filter
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '192.168.122.10/24'|ansible.utils.previous_nth_usable(2) }}"
|
result1: "{{ '192.168.122.10/24'|ansible.utils.previous_nth_usable(2) }}"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ result1 == '192.168.122.8' }}"
|
that: "{{ result1 == '192.168.122.8' }}"
|
||||||
|
|
||||||
- name: previous_nth_usable filter
|
- name: Previous_nth_usable filter
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ '192.168.122.1/24'|ansible.utils.previous_nth_usable(2) }}"
|
result1: "{{ '192.168.122.1/24'|ansible.utils.previous_nth_usable(2) }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: reduce_on_network filter test1
|
- name: Reduce_on_network filter test1
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ ['192.168.0.34', '10.3.0.3', '192.168.2.34'] |ansible.utils.reduce_on_network('192.168.0.0/24') }}"
|
result1: "{{ ['192.168.0.34', '10.3.0.3', '192.168.2.34'] |ansible.utils.reduce_on_network('192.168.0.0/24') }}"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- name: slaac filter test1
|
- name: Slaac filter test1
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
result1: "{{ 'fdcf:1894:23b5:d38c:0000:0000:0000:0000'|ansible.utils.slaac('c2:31:b3:83:bf:2b') }}"
|
result1: "{{ 'fdcf:1894:23b5:d38c:0000:0000:0000:0000'|ansible.utils.slaac('c2:31:b3:83:bf:2b') }}"
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
---
|
---
|
||||||
- name: "in_any_network: :Check if 10.1.1.1 is in the provided network list"
|
- name: "In_any_network: :Check if 10.1.1.1 is in the provided network list"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- "{{ '10.1.1.1' is ansible.utils.in_any_network networks }}"
|
- "{{ '10.1.1.1' is ansible.utils.in_any_network networks }}"
|
||||||
|
|
||||||
- name: "in_any_network: Check if 8.8.8.8 is not in the provided network list"
|
- name: "In_any_network: Check if 8.8.8.8 is not in the provided network list"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '8.8.8.8' is not ansible.utils.in_any_network networks }}"
|
that: "{{ '8.8.8.8' is not ansible.utils.in_any_network networks }}"
|
||||||
|
|
||||||
- name: "in_any_network: Test invalidness"
|
- name: "In_any_network: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check: "{{ '192.168.4.56' is ansible.utils.in_any_network networks }}"
|
criteria_check: "{{ '192.168.4.56' is ansible.utils.in_any_network networks }}"
|
||||||
|
|
||||||
- name: "in_any_network: Assert invalidness"
|
- name: "In_any_network: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check == false }}"
|
that: "{{ criteria_check == false }}"
|
||||||
|
|
|
@ -1,32 +1,32 @@
|
||||||
---
|
---
|
||||||
- name: "in_network: Check if 10.1.1.1 is in 10.0.0.0/8"
|
- name: "In_network: Check if 10.1.1.1 is in 10.0.0.0/8"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '10.1.1.1' is ansible.utils.in_network '10.0.0.0/8' }}"
|
that: "{{ '10.1.1.1' is ansible.utils.in_network '10.0.0.0/8' }}"
|
||||||
|
|
||||||
- name: "in_network: Check if 10.1.1.1 is not in 192.168.1.0/24"
|
- name: "In_network: Check if 10.1.1.1 is not in 192.168.1.0/24"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '10.1.1.1' is not ansible.utils.in_network '192.168.1.0/24' }}"
|
that: "{{ '10.1.1.1' is not ansible.utils.in_network '192.168.1.0/24' }}"
|
||||||
|
|
||||||
- name: "in_network: Test invalidness"
|
- name: "In_network: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ '8.8.8.8' is ansible.utils.in_network '10.0.0.0/8' }}"
|
criteria_check1: "{{ '8.8.8.8' is ansible.utils.in_network '10.0.0.0/8' }}"
|
||||||
|
|
||||||
- name: "in_network: Assert invalidness"
|
- name: "In_network: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "in_network: Check if 2001:db8:a::123 is in 2001:db8:a::/64"
|
- name: "In_network: Check if 2001:db8:a::123 is in 2001:db8:a::/64"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '2001:db8:a::123' is ansible.utils.in_network '2001:db8:a::/64' }}"
|
that: "{{ '2001:db8:a::123' is ansible.utils.in_network '2001:db8:a::/64' }}"
|
||||||
|
|
||||||
- name: "in_network: Check if 2001:db8:a::123 is not in 10.0.0.0/8"
|
- name: "In_network: Check if 2001:db8:a::123 is not in 10.0.0.0/8"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '2001:db8:a::123' is not ansible.utils.in_network '10.0.0.0/8' }}"
|
that: "{{ '2001:db8:a::123' is not ansible.utils.in_network '10.0.0.0/8' }}"
|
||||||
|
|
||||||
- name: "in_network: Test invalidness"
|
- name: "In_network: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ '2001:db8:a::123' is not ansible.utils.in_network '2001:db8:a::/64' }}"
|
criteria_check2: "{{ '2001:db8:a::123' is not ansible.utils.in_network '2001:db8:a::/64' }}"
|
||||||
|
|
||||||
- name: "in_network: Assert invalidness"
|
- name: "In_network: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
---
|
---
|
||||||
- name: "in_one_network: Check if 10.1.1.1 is in the provided network list"
|
- name: "In_one_network: Check if 10.1.1.1 is in the provided network list"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '10.1.1.1' is ansible.utils.in_one_network networks }}"
|
that: "{{ '10.1.1.1' is ansible.utils.in_one_network networks }}"
|
||||||
|
|
||||||
- name: "in_one_network: Check if 192.168.3.5 is not in the provided network list"
|
- name: "In_one_network: Check if 192.168.3.5 is not in the provided network list"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '192.168.3.5' is not ansible.utils.in_one_network networks }}"
|
that: "{{ '192.168.3.5' is not ansible.utils.in_one_network networks }}"
|
||||||
|
|
||||||
- name: "in_one_network: Test invalidness"
|
- name: "In_one_network: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check: "{{ '172.168.2.16' is ansible.utils.in_one_network networks }}"
|
criteria_check: "{{ '172.168.2.16' is ansible.utils.in_one_network networks }}"
|
||||||
|
|
||||||
- name: "in_one_network: Assert invalidness"
|
- name: "In_one_network: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check == false }}"
|
that: "{{ criteria_check == false }}"
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
---
|
---
|
||||||
- name: "ip: Check if 10.1.1.1 is a valid IP address"
|
- name: "Ip: Check if 10.1.1.1 is a valid IP address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '10.1.1.1' is ansible.utils.ip }}"
|
that: "{{ '10.1.1.1' is ansible.utils.ip }}"
|
||||||
|
|
||||||
- name: "ip: Check if 2001:db8:a::123 is a valid IP address"
|
- name: "Ip: Check if 2001:db8:a::123 is a valid IP address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '2001:db8:a::123' is ansible.utils.ip }}"
|
that: "{{ '2001:db8:a::123' is ansible.utils.ip }}"
|
||||||
|
|
||||||
- name: "ip: Check if 10.0.0.0/8 is a valid IP address"
|
- name: "Ip: Check if 10.0.0.0/8 is a valid IP address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '10.0.0.0/8' is ansible.utils.ip }}"
|
that: "{{ '10.0.0.0/8' is ansible.utils.ip }}"
|
||||||
|
|
||||||
- name: "ip: Test invalidness"
|
- name: "Ip: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ 'string' is ansible.utils.ip }}"
|
criteria_check1: "{{ 'string' is ansible.utils.ip }}"
|
||||||
|
|
||||||
- name: "ip: Assert invalidness"
|
- name: "Ip: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "ip: Test invalidness"
|
- name: "Ip: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ '300.1.1.1' is ansible.utils.ip }}"
|
criteria_check2: "{{ '300.1.1.1' is ansible.utils.ip }}"
|
||||||
|
|
||||||
- name: "ip: Assert invalidness"
|
- name: "Ip: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
|
@ -1,32 +1,32 @@
|
||||||
---
|
---
|
||||||
- name: "ip_address: Check if 10.1.1.1 is a valid IP address"
|
- name: "Ip_address: Check if 10.1.1.1 is a valid IP address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '10.1.1.1' is ansible.utils.ip_address }}"
|
that: "{{ '10.1.1.1' is ansible.utils.ip_address }}"
|
||||||
|
|
||||||
- name: "ip_address: Check if 2001:db8:a::123 is a valid IP address"
|
- name: "Ip_address: Check if 2001:db8:a::123 is a valid IP address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '2001:db8:a::123' is ansible.utils.ip_address }}"
|
that: "{{ '2001:db8:a::123' is ansible.utils.ip_address }}"
|
||||||
|
|
||||||
- name: "ip_address: Test invalidness"
|
- name: "Ip_address: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ '10.0.0.0/8' is ansible.utils.ip_address }}"
|
criteria_check1: "{{ '10.0.0.0/8' is ansible.utils.ip_address }}"
|
||||||
|
|
||||||
- name: "ip_address: Assert invalidness"
|
- name: "Ip_address: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "ip_address: Test invalidness"
|
- name: "Ip_address: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ 'string' is ansible.utils.ip_address }}"
|
criteria_check2: "{{ 'string' is ansible.utils.ip_address }}"
|
||||||
|
|
||||||
- name: "ip_address: Assert invalidness"
|
- name: "Ip_address: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
||||||
- name: "ip_address: Test invalidness"
|
- name: "Ip_address: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check3: "{{ '300.1.1.1' is ansible.utils.ip_address }}"
|
criteria_check3: "{{ '300.1.1.1' is ansible.utils.ip_address }}"
|
||||||
|
|
||||||
- name: "ip_address: Assert invalidness"
|
- name: "Ip_address: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check3 == false }}"
|
that: "{{ criteria_check3 == false }}"
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
---
|
---
|
||||||
- name: "ipv4: Check if 10.0.0.0/8 is a valid IPV4 address"
|
- name: "Ipv4: Check if 10.0.0.0/8 is a valid IPV4 address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '10.0.0.0/8' is ansible.utils.ipv4 }}"
|
that: "{{ '10.0.0.0/8' is ansible.utils.ipv4 }}"
|
||||||
|
|
||||||
- name: "ipv4: Check if 192.168.1.250 is a valid IPV4 address"
|
- name: "Ipv4: Check if 192.168.1.250 is a valid IPV4 address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '192.168.1.250' is ansible.utils.ipv4 }}"
|
that: "{{ '192.168.1.250' is ansible.utils.ipv4 }}"
|
||||||
|
|
||||||
- name: "ipv4: Test invalidness"
|
- name: "Ipv4: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ 'fe80::216:3eff:fee4:16f3' is ansible.utils.ipv4 }}"
|
criteria_check1: "{{ 'fe80::216:3eff:fee4:16f3' is ansible.utils.ipv4 }}"
|
||||||
|
|
||||||
- name: "ipv4: Assert invalidness"
|
- name: "Ipv4: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "ipv4: Test invalidness"
|
- name: "Ipv4: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ 'string' is ansible.utils.ipv4 }}"
|
criteria_check2: "{{ 'string' is ansible.utils.ipv4 }}"
|
||||||
|
|
||||||
- name: "ipv4: Assert invalidness"
|
- name: "Ipv4: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
---
|
---
|
||||||
- name: "ipv4_address: Check if 192.168.1.250 is a valid IPV4 address"
|
- name: "Ipv4_address: Check if 192.168.1.250 is a valid IPV4 address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '192.168.1.250' is ansible.utils.ipv4_address }}"
|
that: "{{ '192.168.1.250' is ansible.utils.ipv4_address }}"
|
||||||
|
|
||||||
- name: "ipv4_address: Test invalidness"
|
- name: "Ipv4_address: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ '10.0.0.0/8' is ansible.utils.ipv4_address }}"
|
criteria_check1: "{{ '10.0.0.0/8' is ansible.utils.ipv4_address }}"
|
||||||
|
|
||||||
- name: "ipv4_address: Assert invalidness"
|
- name: "Ipv4_address: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "ipv4_address: Test invalidness"
|
- name: "Ipv4_address: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ 'fe80::216:3eff:fee4:16f3' is ansible.utils.ipv4_address }}"
|
criteria_check2: "{{ 'fe80::216:3eff:fee4:16f3' is ansible.utils.ipv4_address }}"
|
||||||
|
|
||||||
- name: "ipv4_address: Assert invalidness"
|
- name: "Ipv4_address: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
||||||
- name: "ipv4_address: Test invalidness"
|
- name: "Ipv4_address: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check3: "{{ 'string' is ansible.utils.ipv4_address }}"
|
criteria_check3: "{{ 'string' is ansible.utils.ipv4_address }}"
|
||||||
|
|
||||||
- name: "ipv4_address: Assert invalidness"
|
- name: "Ipv4_address: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check3 == false }}"
|
that: "{{ criteria_check3 == false }}"
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
---
|
---
|
||||||
- name: "ipv4_hostmask: Check if 0.0.0.255 is a hostmask"
|
- name: "Ipv4_hostmask: Check if 0.0.0.255 is a hostmask"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '0.0.0.255' is ansible.utils.ipv4_hostmask }}"
|
that: "{{ '0.0.0.255' is ansible.utils.ipv4_hostmask }}"
|
||||||
|
|
||||||
- name: "ipv4_hostmask: Test invalidness"
|
- name: "Ipv4_hostmask: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ '255.255.255.0' is ansible.utils.ipv4_hostmask }}"
|
criteria_check1: "{{ '255.255.255.0' is ansible.utils.ipv4_hostmask }}"
|
||||||
|
|
||||||
- name: "ipv4_hostmask: Assert invalidness"
|
- name: "Ipv4_hostmask: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "ipv4_hostmask: Test invalidness"
|
- name: "Ipv4_hostmask: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ '10.1.1.1' is ansible.utils.ipv4_hostmask }}"
|
criteria_check2: "{{ '10.1.1.1' is ansible.utils.ipv4_hostmask }}"
|
||||||
|
|
||||||
- name: "ipv4_hostmask: Assert invalidness"
|
- name: "Ipv4_hostmask: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
---
|
---
|
||||||
- name: "ipv4_netmask: Check if 255.255.255.0 is a netmask"
|
- name: "Ipv4_netmask: Check if 255.255.255.0 is a netmask"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '255.255.255.0' is ansible.utils.ipv4_netmask }}"
|
that: "{{ '255.255.255.0' is ansible.utils.ipv4_netmask }}"
|
||||||
|
|
||||||
- name: "ipv4_netmask: Test invalidness"
|
- name: "Ipv4_netmask: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ '0.0.0.255' is ansible.utils.ipv4_netmask }}"
|
criteria_check1: "{{ '0.0.0.255' is ansible.utils.ipv4_netmask }}"
|
||||||
|
|
||||||
- name: "ipv4_netmask: Assert invalidness"
|
- name: "Ipv4_netmask: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "ipv4_netmask: Test invalidness"
|
- name: "Ipv4_netmask: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ '10.1.1.1' is ansible.utils.ipv4_netmask }}"
|
criteria_check2: "{{ '10.1.1.1' is ansible.utils.ipv4_netmask }}"
|
||||||
|
|
||||||
- name: "ipv4_netmask: Assert invalidness"
|
- name: "Ipv4_netmask: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
---
|
---
|
||||||
- name: "ipv6: Check if fe80::216:3eff:fee4:16f3 is a valid IPV6 address"
|
- name: "Ipv6: Check if fe80::216:3eff:fee4:16f3 is a valid IPV6 address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ 'fe80::216:3eff:fee4:16f3' is ansible.utils.ipv6 }}"
|
that: "{{ 'fe80::216:3eff:fee4:16f3' is ansible.utils.ipv6 }}"
|
||||||
|
|
||||||
- name: "ipv6: Check if 2001:db8:a::/64 is a valid IPV6 address"
|
- name: "Ipv6: Check if 2001:db8:a::/64 is a valid IPV6 address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '2001:db8:a::/64' is ansible.utils.ipv6 }}"
|
that: "{{ '2001:db8:a::/64' is ansible.utils.ipv6 }}"
|
||||||
|
|
||||||
- name: "ipv6: Test invalidness"
|
- name: "Ipv6: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ '10.1.1.1' is ansible.utils.ipv6 }}"
|
criteria_check1: "{{ '10.1.1.1' is ansible.utils.ipv6 }}"
|
||||||
|
|
||||||
- name: "ipv6: Assert invalidness"
|
- name: "Ipv6: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "ipv6: Test invalidness"
|
- name: "Ipv6: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ 'string' is ansible.utils.ipv6 }}"
|
criteria_check2: "{{ 'string' is ansible.utils.ipv6 }}"
|
||||||
|
|
||||||
- name: "ipv6: Assert invalidness"
|
- name: "Ipv6: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
---
|
---
|
||||||
- name: "ipv6_address: Check if fe80::216:3eff:fee4:16f3 is a valid IPV6 address"
|
- name: "Ipv6_address: Check if fe80::216:3eff:fee4:16f3 is a valid IPV6 address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ 'fe80::216:3eff:fee4:16f3' is ansible.utils.ipv6_address }}"
|
that: "{{ 'fe80::216:3eff:fee4:16f3' is ansible.utils.ipv6_address }}"
|
||||||
|
|
||||||
- name: "ipv6_address: Test invalidness"
|
- name: "Ipv6_address: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ '2001:db8:a::123/64' is ansible.utils.ipv6_address }}"
|
criteria_check1: "{{ '2001:db8:a::123/64' is ansible.utils.ipv6_address }}"
|
||||||
|
|
||||||
- name: "ipv6_address: Assert invalidness"
|
- name: "Ipv6_address: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "ipv6_address: Test invalidness"
|
- name: "Ipv6_address: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ '192.168.1.250' is ansible.utils.ipv6_address }}"
|
criteria_check2: "{{ '192.168.1.250' is ansible.utils.ipv6_address }}"
|
||||||
|
|
||||||
- name: "ipv6_address: Assert invalidness"
|
- name: "Ipv6_address: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
||||||
- name: "ipv6_address: Test invalidness"
|
- name: "Ipv6_address: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check3: "{{ 'string' is ansible.utils.ipv6_address }}"
|
criteria_check3: "{{ 'string' is ansible.utils.ipv6_address }}"
|
||||||
|
|
||||||
- name: "ipv6_address: Assert invalidness"
|
- name: "Ipv6_address: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check3 == false }}"
|
that: "{{ criteria_check3 == false }}"
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
---
|
---
|
||||||
- name: "ipv6_ipv4_mapped: Check if ::FFFF:10.1.1.1 is a valid IPv4-mapped IPv6 address"
|
- name: "Ipv6_ipv4_mapped: Check if ::FFFF:10.1.1.1 is a valid IPv4-mapped IPv6 address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '::FFFF:10.1.1.1' is ansible.utils.ipv6_ipv4_mapped }}"
|
that: "{{ '::FFFF:10.1.1.1' is ansible.utils.ipv6_ipv4_mapped }}"
|
||||||
|
|
||||||
- name: "ipv6_ipv4_mapped: Test invalidness"
|
- name: "Ipv6_ipv4_mapped: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ '::AAAA:10.1.1.1' is ansible.utils.ipv6_ipv4_mapped }}"
|
criteria_check1: "{{ '::AAAA:10.1.1.1' is ansible.utils.ipv6_ipv4_mapped }}"
|
||||||
|
|
||||||
- name: "ipv6_ipv4_mapped: Assert invalidness"
|
- name: "Ipv6_ipv4_mapped: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "ipv6_ipv4_mapped: Test invalidness"
|
- name: "Ipv6_ipv4_mapped: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ 'hello-world' is ansible.utils.ipv6_ipv4_mapped }}"
|
criteria_check2: "{{ 'hello-world' is ansible.utils.ipv6_ipv4_mapped }}"
|
||||||
|
|
||||||
- name: "ipv6_ipv4_mapped: Assert invalidness"
|
- name: "Ipv6_ipv4_mapped: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
---
|
---
|
||||||
- name: "ipv6_sixtofour: Check if 2002:c0a8:6301:1::1 is a valid 6to4 address"
|
- name: "Ipv6_sixtofour: Check if 2002:c0a8:6301:1::1 is a valid 6to4 address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '2002:c0a8:6301:1::1' is ansible.utils.ipv6_sixtofour }}"
|
that: "{{ '2002:c0a8:6301:1::1' is ansible.utils.ipv6_sixtofour }}"
|
||||||
|
|
||||||
- name: "ipv6_sixtofour: Test invalidness"
|
- name: "Ipv6_sixtofour: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ '2001:c0a8:6301:1::1' is ansible.utils.ipv6_sixtofour }}"
|
criteria_check1: "{{ '2001:c0a8:6301:1::1' is ansible.utils.ipv6_sixtofour }}"
|
||||||
|
|
||||||
- name: "ipv6_sixtofour: Assert invalidness"
|
- name: "Ipv6_sixtofour: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "ipv6_sixtofour: Test invalidness"
|
- name: "Ipv6_sixtofour: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ 'helloworld' is ansible.utils.ipv6_sixtofour }}"
|
criteria_check2: "{{ 'helloworld' is ansible.utils.ipv6_sixtofour }}"
|
||||||
|
|
||||||
- name: "ipv6_sixtofour: Assert invalidness"
|
- name: "Ipv6_sixtofour: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
---
|
---
|
||||||
- name: "ipv6_teredo: Check if 2001::c0a8:6301:1 is a valid 6to4 address"
|
- name: "Ipv6_teredo: Check if 2001::c0a8:6301:1 is a valid 6to4 address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '2001::c0a8:6301:1' is ansible.utils.ipv6_teredo }}"
|
that: "{{ '2001::c0a8:6301:1' is ansible.utils.ipv6_teredo }}"
|
||||||
|
|
||||||
- name: "ipv6_teredo: Test invalidness"
|
- name: "Ipv6_teredo: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ '2002::c0a8:6301:1' is ansible.utils.ipv6_teredo }}"
|
criteria_check1: "{{ '2002::c0a8:6301:1' is ansible.utils.ipv6_teredo }}"
|
||||||
|
|
||||||
- name: "ipv6_teredo: Assert invalidness"
|
- name: "Ipv6_teredo: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "ipv6_teredo: Test invalidness"
|
- name: "Ipv6_teredo: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ 'helloworld' is ansible.utils.ipv6_teredo }}"
|
criteria_check2: "{{ 'helloworld' is ansible.utils.ipv6_teredo }}"
|
||||||
|
|
||||||
- name: "ipv6_teredo: Assert invalidness"
|
- name: "Ipv6_teredo: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
---
|
---
|
||||||
- name: "loopback: Check if 127.10.10.10 is a valid loopback address"
|
- name: "Loopback: Check if 127.10.10.10 is a valid loopback address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '127.10.10.10' is ansible.utils.loopback }}"
|
that: "{{ '127.10.10.10' is ansible.utils.loopback }}"
|
||||||
|
|
||||||
- name: "loopback: Check if ::1 is a valid loopback address"
|
- name: "Loopback: Check if ::1 is a valid loopback address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '::1' is ansible.utils.loopback }}"
|
that: "{{ '::1' is ansible.utils.loopback }}"
|
||||||
|
|
||||||
- name: "loopback: Test invalidness"
|
- name: "Loopback: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check: "{{ '10.1.1.1' is ansible.utils.loopback }}"
|
criteria_check: "{{ '10.1.1.1' is ansible.utils.loopback }}"
|
||||||
|
|
||||||
- name: "loopback: Assert invalidness"
|
- name: "Loopback: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check == false }}"
|
that: "{{ criteria_check == false }}"
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
---
|
---
|
||||||
- name: "mac: Check if 02:16:3e:e4:16:f3 is a valid MAC address"
|
- name: "Mac: Check if 02:16:3e:e4:16:f3 is a valid MAC address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '02:16:3e:e4:16:f3' is ansible.utils.mac }}"
|
that: "{{ '02:16:3e:e4:16:f3' is ansible.utils.mac }}"
|
||||||
|
|
||||||
- name: "mac: Check if 02-16-3e-e4-16-f3 is a valid MAC address"
|
- name: "Mac: Check if 02-16-3e-e4-16-f3 is a valid MAC address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '02-16-3e-e4-16-f3' is ansible.utils.mac }}"
|
that: "{{ '02-16-3e-e4-16-f3' is ansible.utils.mac }}"
|
||||||
|
|
||||||
- name: "mac: Check if 0216.3ee4.16f3 is a valid MAC address"
|
- name: "Mac: Check if 0216.3ee4.16f3 is a valid MAC address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '0216.3ee4.16f3' is ansible.utils.mac }}"
|
that: "{{ '0216.3ee4.16f3' is ansible.utils.mac }}"
|
||||||
|
|
||||||
- name: "mac: Check if 02163ee416f3 is a valid MAC address"
|
- name: "Mac: Check if 02163ee416f3 is a valid MAC address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '02163ee416f3' is ansible.utils.mac }}"
|
that: "{{ '02163ee416f3' is ansible.utils.mac }}"
|
||||||
|
|
||||||
- name: "mac: Check invalidness"
|
- name: "Mac: Check invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check: "{{ 'string' is ansible.utils.mac }}"
|
criteria_check: "{{ 'string' is ansible.utils.mac }}"
|
||||||
|
|
||||||
- name: "mac: Assert invalidness"
|
- name: "Mac: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check == false }}"
|
that: "{{ criteria_check == false }}"
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
---
|
---
|
||||||
- name: "multicast: Check if 224.0.0.1 is a valid multicast IP address"
|
- name: "Multicast: Check if 224.0.0.1 is a valid multicast IP address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '224.0.0.1' is ansible.utils.multicast }}"
|
that: "{{ '224.0.0.1' is ansible.utils.multicast }}"
|
||||||
|
|
||||||
- name: "multicast: Check if ff02::1 is a valid multicast IP address"
|
- name: "Multicast: Check if ff02::1 is a valid multicast IP address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ 'ff02::1' is ansible.utils.multicast }}"
|
that: "{{ 'ff02::1' is ansible.utils.multicast }}"
|
||||||
|
|
||||||
- name: "multicast: Test invalidness"
|
- name: "Multicast: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ '127.0.0.1' is ansible.utils.multicast }}"
|
criteria_check1: "{{ '127.0.0.1' is ansible.utils.multicast }}"
|
||||||
|
|
||||||
- name: "multicast: Assert invalidness"
|
- name: "Multicast: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "multicast: Test invalidness"
|
- name: "Multicast: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ 'helloworld' is ansible.utils.multicast }}"
|
criteria_check2: "{{ 'helloworld' is ansible.utils.multicast }}"
|
||||||
|
|
||||||
- name: "multicast: Assert invalidness"
|
- name: "Multicast: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
---
|
---
|
||||||
- name: "private: Check if 10.1.1.1 is a private IP address"
|
- name: "Private: Check if 10.1.1.1 is a private IP address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '10.1.1.1' is ansible.utils.private }}"
|
that: "{{ '10.1.1.1' is ansible.utils.private }}"
|
||||||
|
|
||||||
- name: "private: Test invalidness"
|
- name: "Private: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check: "{{ '8.8.8.8' is ansible.utils.private }}"
|
criteria_check: "{{ '8.8.8.8' is ansible.utils.private }}"
|
||||||
|
|
||||||
- name: "private: Assert invalidness"
|
- name: "Private: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check == false }}"
|
that: "{{ criteria_check == false }}"
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
---
|
---
|
||||||
- name: "public: Check if 8.8.8.8 is a public IP address"
|
- name: "Public: Check if 8.8.8.8 is a public IP address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '8.8.8.8' is ansible.utils.public }}"
|
that: "{{ '8.8.8.8' is ansible.utils.public }}"
|
||||||
|
|
||||||
- name: "public: Test invalidness"
|
- name: "Public: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check: "{{ '10.1.1.1' is ansible.utils.public }}"
|
criteria_check: "{{ '10.1.1.1' is ansible.utils.public }}"
|
||||||
|
|
||||||
- name: "public: Assert invalidness"
|
- name: "Public: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check == false }}"
|
that: "{{ criteria_check == false }}"
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
---
|
---
|
||||||
- name: "reserved: Check if 253.0.0.1 is a reserved IP address"
|
- name: "Reserved: Check if 253.0.0.1 is a reserved IP address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '253.0.0.1' is ansible.utils.reserved }}"
|
that: "{{ '253.0.0.1' is ansible.utils.reserved }}"
|
||||||
|
|
||||||
- name: "reserved: Test invalidness"
|
- name: "Reserved: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check: "{{ '128.146.1.7' is ansible.utils.reserved }}"
|
criteria_check: "{{ '128.146.1.7' is ansible.utils.reserved }}"
|
||||||
|
|
||||||
- name: "reserved: Assert invalidness"
|
- name: "Reserved: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check == false }}"
|
that: "{{ criteria_check == false }}"
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
---
|
---
|
||||||
- name: "resolvable: Check if good_name is resolvable or not"
|
- name: "Resolvable: Check if good_name is resolvable or not"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ good_name is ansible.utils.resolvable }}"
|
that: "{{ good_name is ansible.utils.resolvable }}"
|
||||||
|
|
||||||
- name: "resolvable: Check if ipv4_localhost is resolvable or not"
|
- name: "Resolvable: Check if ipv4_localhost is resolvable or not"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ ipv4_localhost is ansible.utils.resolvable }}"
|
that: "{{ ipv4_localhost is ansible.utils.resolvable }}"
|
||||||
|
|
||||||
- name: "resolvable: Check if ipv6_localhost is resolvable or not"
|
- name: "Resolvable: Check if ipv6_localhost is resolvable or not"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ ipv6_localhost is ansible.utils.resolvable }}"
|
that: "{{ ipv6_localhost is ansible.utils.resolvable }}"
|
||||||
|
|
||||||
- name: "resolvable: Test invalidness"
|
- name: "Resolvable: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ bad_name is ansible.utils.resolvable }}"
|
criteria_check1: "{{ bad_name is ansible.utils.resolvable }}"
|
||||||
|
|
||||||
- name: "resolvable: Assert invalidness"
|
- name: "Resolvable: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "resolvable: Test invalidness"
|
- name: "Resolvable: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ 'invalidhost' is ansible.utils.resolvable }}"
|
criteria_check2: "{{ 'invalidhost' is ansible.utils.resolvable }}"
|
||||||
|
|
||||||
- name: "resolvable: Assert invalidness"
|
- name: "Resolvable: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
---
|
---
|
||||||
- name: "subnet_of: Check if 10.1.1.0/24 is a subnet of 10.0.0.0/8"
|
- name: "Subnet_of: Check if 10.1.1.0/24 is a subnet of 10.0.0.0/8"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '10.1.1.0/24' is ansible.utils.subnet_of '10.0.0.0/8' }}"
|
that: "{{ '10.1.1.0/24' is ansible.utils.subnet_of '10.0.0.0/8' }}"
|
||||||
|
|
||||||
- name: "subnet_of: Test invalidness"
|
- name: "Subnet_of: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ '10.0.0.0/8' is ansible.utils.subnet_of '10.1.1.0/24' }}"
|
criteria_check1: "{{ '10.0.0.0/8' is ansible.utils.subnet_of '10.1.1.0/24' }}"
|
||||||
|
|
||||||
- name: "subnet_of: Assert invalidness"
|
- name: "Subnet_of: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "subnet_of: Test invalidness"
|
- name: "Subnet_of: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ '192.168.1.0/24' is ansible.utils.subnet_of '10.0.0.0/8' }}"
|
criteria_check2: "{{ '192.168.1.0/24' is ansible.utils.subnet_of '10.0.0.0/8' }}"
|
||||||
|
|
||||||
- name: "subnet_of: Assert invalidness"
|
- name: "Subnet_of: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
---
|
---
|
||||||
- name: "supernet_of: Check if 10.0.0.0/8 is a supernet of 10.1.1.0/24"
|
- name: "Supernet_of: Check if 10.0.0.0/8 is a supernet of 10.1.1.0/24"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '10.0.0.0/8' is ansible.utils.supernet_of '10.1.1.0/24' }}"
|
that: "{{ '10.0.0.0/8' is ansible.utils.supernet_of '10.1.1.0/24' }}"
|
||||||
|
|
||||||
- name: "supernet_of: Test invalidness"
|
- name: "Supernet_of: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ '10.1.1.0/24' is ansible.utils.supernet_of '10.0.0.0/8' }}"
|
criteria_check1: "{{ '10.1.1.0/24' is ansible.utils.supernet_of '10.0.0.0/8' }}"
|
||||||
|
|
||||||
- name: "supernet_of: Assert invalidness"
|
- name: "Supernet_of: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "supernet_of: Test invalidness"
|
- name: "Supernet_of: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ '10.0.0.0/8' is ansible.utils.supernet_of '192.168.1.0/24' }}"
|
criteria_check2: "{{ '10.0.0.0/8' is ansible.utils.supernet_of '192.168.1.0/24' }}"
|
||||||
|
|
||||||
- name: "supernet_of: Assert invalidness"
|
- name: "Supernet_of: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
---
|
---
|
||||||
- name: "unspecified: Check if 0.0.0.0 is an unspecified IP address"
|
- name: "Unspecified: Check if 0.0.0.0 is an unspecified IP address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '0.0.0.0' is ansible.utils.unspecified }}"
|
that: "{{ '0.0.0.0' is ansible.utils.unspecified }}"
|
||||||
|
|
||||||
- name: "unspecified: Check if 0:0:0:0:0:0:0:0 is an unspecified IP address"
|
- name: "Unspecified: Check if 0:0:0:0:0:0:0:0 is an unspecified IP address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '0:0:0:0:0:0:0:0' is ansible.utils.unspecified }}"
|
that: "{{ '0:0:0:0:0:0:0:0' is ansible.utils.unspecified }}"
|
||||||
|
|
||||||
- name: "unspecified: Check if :: is an unspecified IP address"
|
- name: "Unspecified: Check if :: is an unspecified IP address"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ '::' is ansible.utils.unspecified }}"
|
that: "{{ '::' is ansible.utils.unspecified }}"
|
||||||
|
|
||||||
- name: "unspecified: Test invalidness"
|
- name: "Unspecified: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check1: "{{ '127.0.0.1' is ansible.utils.unspecified }}"
|
criteria_check1: "{{ '127.0.0.1' is ansible.utils.unspecified }}"
|
||||||
|
|
||||||
- name: "unspecified: Assert invalidness"
|
- name: "Unspecified: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check1 == false }}"
|
that: "{{ criteria_check1 == false }}"
|
||||||
|
|
||||||
- name: "unspecified: Test invalidness"
|
- name: "Unspecified: Test invalidness"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
criteria_check2: "{{ '::1' is ansible.utils.unspecified }}"
|
criteria_check2: "{{ '::1' is ansible.utils.unspecified }}"
|
||||||
|
|
||||||
- name: "unspecified: Assert invalidness"
|
- name: "Unspecified: Assert invalidness"
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that: "{{ criteria_check2 == false }}"
|
that: "{{ criteria_check2 == false }}"
|
||||||
|
|
|
@ -17,13 +17,13 @@
|
||||||
- test: "{{ data|ansible.utils.to_xml() }}"
|
- test: "{{ data|ansible.utils.to_xml() }}"
|
||||||
- test: "{{ data|ansible.utils.to_xml('xmltodict') }}"
|
- test: "{{ data|ansible.utils.to_xml('xmltodict') }}"
|
||||||
|
|
||||||
- name: test for supported engine for to_xml filter
|
- name: Test for supported engine for to_xml filter
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
data:
|
data:
|
||||||
"interface-configurations":
|
"interface-configurations":
|
||||||
"@xmlns": "http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"
|
"@xmlns": "http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"
|
||||||
|
|
||||||
- name: validate input xml
|
- name: Validate input xml
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
_result: "{{ data|ansible.utils.to_xml('dicttoxml') }}"
|
_result: "{{ data|ansible.utils.to_xml('dicttoxml') }}"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
Loading…
Reference in New Issue