From e5591508fa8ab2535eeae8e7364ea0daf7e51ee2 Mon Sep 17 00:00:00 2001 From: Ashwini Mhatre Date: Tue, 29 Nov 2022 19:28:12 +0530 Subject: [PATCH] Fix Ansible lint FQCN error (#227) * Fix set_fact ansible-lint * Fix assert ansible-lint * Fix find ansible-lint * Fix debug ansible-lint * Add FQCN --- changelogs/fragments/Ansible_lint_fix1.yaml | 3 +++ .../utils_cli_parse/tasks/argspec.yaml | 8 +++---- .../utils_cli_parse/tasks/centos_textfsm.yaml | 4 ++-- .../utils_cli_parse/tasks/centos_ttp.yaml | 4 ++-- .../utils_cli_parse/tasks/fedora_textfsm.yaml | 4 ++-- .../utils_cli_parse/tasks/fedora_ttp.yaml | 4 ++-- .../targets/utils_cli_parse/tasks/main.yaml | 24 +++++++++---------- .../utils_cli_parse/tasks/nxos_json.yaml | 2 +- .../utils_cli_parse/tasks/nxos_textfsm.yaml | 2 +- .../utils_cli_parse/tasks/nxos_ttp.yaml | 6 ++--- .../utils_cli_parse/tasks/nxos_xml.yaml | 2 +- .../utils_cli_parse/tasks/ubuntu_textfsm.yaml | 4 ++-- .../utils_cli_parse/tasks/ubuntu_ttp.yaml | 4 ++-- .../targets/utils_consolidate/tasks/main.yaml | 4 ++-- .../utils_consolidate/tasks/simple.yaml | 2 +- .../utils_fact_diff/tasks/argspec.yaml | 8 +++---- .../targets/utils_fact_diff/tasks/main.yaml | 4 ++-- .../targets/utils_fact_diff/tasks/simple.yaml | 2 +- .../targets/utils_from_xml/tasks/main.yaml | 4 ++-- .../targets/utils_from_xml/tasks/simple.yaml | 6 ++--- .../targets/utils_get_path/tasks/argspec.yaml | 4 ++-- .../targets/utils_get_path/tasks/main.yaml | 4 ++-- .../targets/utils_get_path/tasks/simple.yaml | 4 ++-- .../targets/utils_index_of/tasks/argspec.yaml | 8 +++---- .../utils_index_of/tasks/examples_filter.yaml | 22 ++++++++--------- .../utils_index_of/tasks/examples_lookup.yaml | 10 ++++---- .../targets/utils_index_of/tasks/main.yaml | 4 ++-- .../targets/utils_index_of/tasks/simple.yaml | 10 ++++---- .../utils_ipaddr_filter/tasks/cidr_merge.yaml | 4 ++-- .../utils_ipaddr_filter/tasks/hwaddr.yaml | 4 ++-- .../utils_ipaddr_filter/tasks/ip4_hex.yaml | 4 ++-- .../utils_ipaddr_filter/tasks/ipaddr.yaml | 20 ++++++++-------- .../utils_ipaddr_filter/tasks/ipmath.yaml | 12 +++++----- .../utils_ipaddr_filter/tasks/ipsubnet.yaml | 20 ++++++++-------- .../utils_ipaddr_filter/tasks/ipv4.yaml | 8 +++---- .../utils_ipaddr_filter/tasks/ipv6.yaml | 8 +++---- .../utils_ipaddr_filter/tasks/ipwrap.yaml | 4 ++-- .../utils_ipaddr_filter/tasks/macaddr.yaml | 4 ++-- .../utils_ipaddr_filter/tasks/main.yaml | 4 ++-- .../tasks/network_in_network.yaml | 6 ++--- .../tasks/network_in_usable.yaml | 6 ++--- .../tasks/next_nth_usable.yaml | 4 ++-- .../utils_ipaddr_filter/tasks/nthhost.yaml | 4 ++-- .../tasks/previous_nth_usable.yaml | 4 ++-- .../tasks/reduce_on_network.yaml | 2 +- .../utils_ipaddr_filter/tasks/slaac.yaml | 2 +- .../targets/utils_keep_keys/tasks/main.yaml | 4 ++-- .../targets/utils_keep_keys/tasks/simple.yaml | 8 +++---- .../tasks/in_any_network.yml | 6 ++--- .../utils_netaddr_test/tasks/in_network.yml | 12 +++++----- .../tasks/in_one_network.yml | 6 ++--- .../targets/utils_netaddr_test/tasks/ip.yml | 10 ++++---- .../utils_netaddr_test/tasks/ip_address.yml | 10 ++++---- .../targets/utils_netaddr_test/tasks/ipv4.yml | 8 +++---- .../utils_netaddr_test/tasks/ipv4_address.yml | 8 +++---- .../tasks/ipv4_hostmask.yml | 6 ++--- .../utils_netaddr_test/tasks/ipv4_netmask.yml | 6 ++--- .../targets/utils_netaddr_test/tasks/ipv6.yml | 8 +++---- .../utils_netaddr_test/tasks/ipv6_address.yml | 8 +++---- .../tasks/ipv6_ipv4_mapped.yml | 6 ++--- .../tasks/ipv6_sixtofour.yml | 6 ++--- .../utils_netaddr_test/tasks/ipv6_teredo.yml | 6 ++--- .../utils_netaddr_test/tasks/loopback.yml | 6 ++--- .../targets/utils_netaddr_test/tasks/mac.yml | 10 ++++---- .../utils_netaddr_test/tasks/main.yaml | 4 ++-- .../utils_netaddr_test/tasks/multicast.yml | 8 +++---- .../utils_netaddr_test/tasks/private.yml | 4 ++-- .../utils_netaddr_test/tasks/public.yml | 4 ++-- .../utils_netaddr_test/tasks/reserved.yml | 4 ++-- .../utils_netaddr_test/tasks/resolvable.yml | 10 ++++---- .../utils_netaddr_test/tasks/subnet_of.yml | 6 ++--- .../utils_netaddr_test/tasks/supernet_of.yml | 6 ++--- .../utils_netaddr_test/tasks/unspecified.yml | 10 ++++---- .../utils_param_list_compare/tasks/main.yaml | 4 ++-- .../tasks/simple.yaml | 8 +++---- .../targets/utils_remove_keys/tasks/main.yaml | 4 ++-- .../utils_remove_keys/tasks/simple.yaml | 4 ++-- .../utils_replace_keys/tasks/main.yaml | 4 ++-- .../utils_replace_keys/tasks/simple.yaml | 4 ++-- .../targets/utils_to_paths/tasks/argspec.yaml | 8 +++---- .../utils_to_paths/tasks/empty_members.yaml | 2 +- .../targets/utils_to_paths/tasks/main.yaml | 4 ++-- .../targets/utils_to_paths/tasks/simple.yaml | 4 ++-- .../targets/utils_to_xml/tasks/main.yaml | 4 ++-- .../targets/utils_to_xml/tasks/simple.yaml | 6 ++--- .../targets/utils_update_fact/tasks/main.yaml | 6 ++--- .../utils_usable_range/tasks/argspec.yml | 14 +++++------ .../tasks/example_filter.yml | 10 ++++---- .../targets/utils_usable_range/tasks/main.yml | 4 ++-- .../targets/utils_validate/tasks/main.yaml | 4 ++-- .../utils_validate/tests/config/filter.yaml | 8 +++---- .../utils_validate/tests/config/lookup.yaml | 8 +++---- .../utils_validate/tests/config/module.yaml | 8 +++---- .../utils_validate/tests/config/test.yaml | 8 +++---- .../tests/jsonschema/filter.yaml | 16 ++++++------- .../tests/jsonschema/lookup.yaml | 18 +++++++------- .../tests/jsonschema/module.yaml | 18 +++++++------- .../utils_validate/tests/jsonschema/test.yaml | 18 +++++++------- 98 files changed, 338 insertions(+), 335 deletions(-) create mode 100644 changelogs/fragments/Ansible_lint_fix1.yaml diff --git a/changelogs/fragments/Ansible_lint_fix1.yaml b/changelogs/fragments/Ansible_lint_fix1.yaml new file mode 100644 index 0000000..6060abb --- /dev/null +++ b/changelogs/fragments/Ansible_lint_fix1.yaml @@ -0,0 +1,3 @@ +--- +trivial: + - Add FQCN for all short names. diff --git a/tests/integration/targets/utils_cli_parse/tasks/argspec.yaml b/tests/integration/targets/utils_cli_parse/tasks/argspec.yaml index 0e6f757..09d750f 100644 --- a/tests/integration/targets/utils_cli_parse/tasks/argspec.yaml +++ b/tests/integration/targets/utils_cli_parse/tasks/argspec.yaml @@ -10,7 +10,7 @@ ignore_errors: true - name: "{{ parser }} Check argspec fail" - assert: + ansible.builtin.assert: that: "{{ msg in argfail.errors }}" vars: msg: "parameters are mutually exclusive: command|template_path found in parser" @@ -26,7 +26,7 @@ ignore_errors: true - name: "{{ parser }} Check argspec fail" - assert: + ansible.builtin.assert: that: "{{ msg in argfail.errors }}" vars: msg: "parameters are mutually exclusive: command|text" @@ -40,7 +40,7 @@ ignore_errors: true - name: "{{ parser }} Check argspec fail" - assert: + ansible.builtin.assert: that: "{{ msg in argfail.errors }}" vars: msg: "one of the following is required: command, text" @@ -55,7 +55,7 @@ ignore_errors: true - name: "{{ parser }} Check arspec fail" - assert: + ansible.builtin.assert: that: "{{ msg in argfail.msg }}" vars: msg: "Parser name should be provided as a full name including collection" diff --git a/tests/integration/targets/utils_cli_parse/tasks/centos_textfsm.yaml b/tests/integration/targets/utils_cli_parse/tasks/centos_textfsm.yaml index bd3438b..b4b8db8 100644 --- a/tests/integration/targets/utils_cli_parse/tasks/centos_textfsm.yaml +++ b/tests/integration/targets/utils_cli_parse/tasks/centos_textfsm.yaml @@ -4,11 +4,11 @@ command: "ifconfig" parser: name: ansible.utils.textfsm - set_fact: myfact + ansible.builtin.set_fact: myfact register: ifconfig_out - name: "{{ parser }} Check parser output" - assert: + ansible.builtin.assert: that: "{{ item }}" with_items: - "{{ myfact is defined }}" diff --git a/tests/integration/targets/utils_cli_parse/tasks/centos_ttp.yaml b/tests/integration/targets/utils_cli_parse/tasks/centos_ttp.yaml index 6460e0d..15e49d9 100644 --- a/tests/integration/targets/utils_cli_parse/tasks/centos_ttp.yaml +++ b/tests/integration/targets/utils_cli_parse/tasks/centos_ttp.yaml @@ -4,11 +4,11 @@ command: "df -h" parser: name: ansible.utils.ttp - set_fact: myfact + ansible.builtin.set_fact: myfact register: df_h_out - name: "{{ parser }} Check parser output" - assert: + ansible.builtin.assert: that: "{{ item }}" with_items: - "{{ myfact is defined }}" diff --git a/tests/integration/targets/utils_cli_parse/tasks/fedora_textfsm.yaml b/tests/integration/targets/utils_cli_parse/tasks/fedora_textfsm.yaml index bd3438b..b4b8db8 100644 --- a/tests/integration/targets/utils_cli_parse/tasks/fedora_textfsm.yaml +++ b/tests/integration/targets/utils_cli_parse/tasks/fedora_textfsm.yaml @@ -4,11 +4,11 @@ command: "ifconfig" parser: name: ansible.utils.textfsm - set_fact: myfact + ansible.builtin.set_fact: myfact register: ifconfig_out - name: "{{ parser }} Check parser output" - assert: + ansible.builtin.assert: that: "{{ item }}" with_items: - "{{ myfact is defined }}" diff --git a/tests/integration/targets/utils_cli_parse/tasks/fedora_ttp.yaml b/tests/integration/targets/utils_cli_parse/tasks/fedora_ttp.yaml index 6460e0d..15e49d9 100644 --- a/tests/integration/targets/utils_cli_parse/tasks/fedora_ttp.yaml +++ b/tests/integration/targets/utils_cli_parse/tasks/fedora_ttp.yaml @@ -4,11 +4,11 @@ command: "df -h" parser: name: ansible.utils.ttp - set_fact: myfact + ansible.builtin.set_fact: myfact register: df_h_out - name: "{{ parser }} Check parser output" - assert: + ansible.builtin.assert: that: "{{ item }}" with_items: - "{{ myfact is defined }}" diff --git a/tests/integration/targets/utils_cli_parse/tasks/main.yaml b/tests/integration/targets/utils_cli_parse/tasks/main.yaml index 422d541..7b73a8b 100644 --- a/tests/integration/targets/utils_cli_parse/tasks/main.yaml +++ b/tests/integration/targets/utils_cli_parse/tasks/main.yaml @@ -3,74 +3,74 @@ ansible.builtin.set_fact: os: "{{ ansible_distribution|d }}" -- include_tasks: argspec.yaml +- ansible.builtin.include_tasks: argspec.yaml vars: parser: "({{ inventory_hostname }}/argspec)" -- include_tasks: "nxos_json.yaml" +- ansible.builtin.include_tasks: "nxos_json.yaml" vars: parser: "(nxos/json)" tags: - json -- include_tasks: "nxos_textfsm.yaml" +- ansible.builtin.include_tasks: "nxos_textfsm.yaml" vars: parser: "(nxos/textfsm)" tags: - textfsm -- include_tasks: "nxos_ttp.yaml" +- ansible.builtin.include_tasks: "nxos_ttp.yaml" vars: parser: "(nxos/ttp)" tags: - ttp -- include_tasks: "nxos_xml.yaml" +- ansible.builtin.include_tasks: "nxos_xml.yaml" vars: parser: "(nxos/xml)" tags: - xml - name: debug os - debug: + ansible.builtin.debug: msg: "{{ os }}" -- include_tasks: "centos_textfsm.yaml" +- ansible.builtin.include_tasks: "centos_textfsm.yaml" vars: parser: "(centos/textfsm)" when: os == 'centos' tags: - textfsm -- include_tasks: "centos_ttp.yaml" +- ansible.builtin.include_tasks: "centos_ttp.yaml" vars: parser: "(centos/ttp)" when: os == 'centos' tags: - ttp -- include_tasks: "fedora_textfsm.yaml" +- ansible.builtin.include_tasks: "fedora_textfsm.yaml" vars: parser: "(fedora/textfsm)" when: os == 'fedora' tags: - textfsm -- include_tasks: "fedora_ttp.yaml" +- ansible.builtin.include_tasks: "fedora_ttp.yaml" vars: parser: "(fedora/ttp)" when: os == 'fedora' tags: - ttp -- include_tasks: "ubuntu_textfsm.yaml" +- ansible.builtin.include_tasks: "ubuntu_textfsm.yaml" vars: parser: "(ubuntu/textfsm)" when: os == 'ubuntu' tags: - textfsm -- include_tasks: "ubuntu_ttp.yaml" +- ansible.builtin.include_tasks: "ubuntu_ttp.yaml" vars: parser: "(ubuntu/ttp)" when: os == 'ubuntu' diff --git a/tests/integration/targets/utils_cli_parse/tasks/nxos_json.yaml b/tests/integration/targets/utils_cli_parse/tasks/nxos_json.yaml index 2bbefb4..fe3ee58 100644 --- a/tests/integration/targets/utils_cli_parse/tasks/nxos_json.yaml +++ b/tests/integration/targets/utils_cli_parse/tasks/nxos_json.yaml @@ -10,7 +10,7 @@ register: nxos_json_text - name: "{{ parser }} Confirm response" - assert: + ansible.builtin.assert: that: "{{ item }}" with_items: - "{{ nxos_json_text['parsed'] is defined }}" diff --git a/tests/integration/targets/utils_cli_parse/tasks/nxos_textfsm.yaml b/tests/integration/targets/utils_cli_parse/tasks/nxos_textfsm.yaml index 208ab98..9d315e3 100644 --- a/tests/integration/targets/utils_cli_parse/tasks/nxos_textfsm.yaml +++ b/tests/integration/targets/utils_cli_parse/tasks/nxos_textfsm.yaml @@ -11,7 +11,7 @@ register: nxos_textfsm_text - name: "{{ parser }} Confirm response" - assert: + ansible.builtin.assert: that: "{{ item }}" with_items: - "{{ nxos_textfsm_text['parsed'] == nxos_textfsm_text['parsed'] }}" diff --git a/tests/integration/targets/utils_cli_parse/tasks/nxos_ttp.yaml b/tests/integration/targets/utils_cli_parse/tasks/nxos_ttp.yaml index f1bf01b..b56f124 100644 --- a/tests/integration/targets/utils_cli_parse/tasks/nxos_ttp.yaml +++ b/tests/integration/targets/utils_cli_parse/tasks/nxos_ttp.yaml @@ -12,7 +12,7 @@ register: nxos_ttp_text - name: "{{ parser }} Confirm response" - assert: + ansible.builtin.assert: that: - "{{ POpqMQoJWTiDpEW is defined }}" - "{{ nxos_ttp_text['parsed'][0][0] | selectattr('interface', 'search', 'mgmt0') | list | length }}" @@ -30,7 +30,7 @@ register: nxos_ttp_vars - name: "{{ parser }} Confirm modified results" - assert: + ansible.builtin.assert: that: "{{ item }}" with_items: - "{{ nxos_ttp_vars['parsed'][0][0][0]['var'] == 'some_text' }}" @@ -47,7 +47,7 @@ register: nxos_ttp_results - name: "{{ parser }} Confirm modified results" - assert: + ansible.builtin.assert: that: "{{ item }}" with_items: - "{{ (nxos_ttp_results['parsed'][0]|from_yaml)[0] | selectattr('interface', 'search', 'mgmt0') | list | length }}" diff --git a/tests/integration/targets/utils_cli_parse/tasks/nxos_xml.yaml b/tests/integration/targets/utils_cli_parse/tasks/nxos_xml.yaml index edccf85..4dc7555 100644 --- a/tests/integration/targets/utils_cli_parse/tasks/nxos_xml.yaml +++ b/tests/integration/targets/utils_cli_parse/tasks/nxos_xml.yaml @@ -11,7 +11,7 @@ register: nxos_xml_text - name: "{{ parser }} Confirm response" - assert: + ansible.builtin.assert: that: "{{ item }}" with_items: - "{{ nxos_xml_text['parsed'] == nxos_xml_text_parsed }}" diff --git a/tests/integration/targets/utils_cli_parse/tasks/ubuntu_textfsm.yaml b/tests/integration/targets/utils_cli_parse/tasks/ubuntu_textfsm.yaml index bd3438b..b4b8db8 100644 --- a/tests/integration/targets/utils_cli_parse/tasks/ubuntu_textfsm.yaml +++ b/tests/integration/targets/utils_cli_parse/tasks/ubuntu_textfsm.yaml @@ -4,11 +4,11 @@ command: "ifconfig" parser: name: ansible.utils.textfsm - set_fact: myfact + ansible.builtin.set_fact: myfact register: ifconfig_out - name: "{{ parser }} Check parser output" - assert: + ansible.builtin.assert: that: "{{ item }}" with_items: - "{{ myfact is defined }}" diff --git a/tests/integration/targets/utils_cli_parse/tasks/ubuntu_ttp.yaml b/tests/integration/targets/utils_cli_parse/tasks/ubuntu_ttp.yaml index 6460e0d..15e49d9 100644 --- a/tests/integration/targets/utils_cli_parse/tasks/ubuntu_ttp.yaml +++ b/tests/integration/targets/utils_cli_parse/tasks/ubuntu_ttp.yaml @@ -4,11 +4,11 @@ command: "df -h" parser: name: ansible.utils.ttp - set_fact: myfact + ansible.builtin.set_fact: myfact register: df_h_out - name: "{{ parser }} Check parser output" - assert: + ansible.builtin.assert: that: "{{ item }}" with_items: - "{{ myfact is defined }}" diff --git a/tests/integration/targets/utils_consolidate/tasks/main.yaml b/tests/integration/targets/utils_consolidate/tasks/main.yaml index 3b21619..cfc8705 100644 --- a/tests/integration/targets/utils_consolidate/tasks/main.yaml +++ b/tests/integration/targets/utils_consolidate/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tasks" recurse: false @@ -10,5 +10,5 @@ delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_consolidate/tasks/simple.yaml b/tests/integration/targets/utils_consolidate/tasks/simple.yaml index 61c0a28..be42dae 100644 --- a/tests/integration/targets/utils_consolidate/tasks/simple.yaml +++ b/tests/integration/targets/utils_consolidate/tasks/simple.yaml @@ -27,6 +27,6 @@ combined: "{{ data_sources|ansible.utils.consolidate(fail_missing_match_value=False) }}" - name: Assert result dicts - assert: + ansible.builtin.assert: that: - combined == combined_facts diff --git a/tests/integration/targets/utils_fact_diff/tasks/argspec.yaml b/tests/integration/targets/utils_fact_diff/tasks/argspec.yaml index 5606c5b..1ef3356 100644 --- a/tests/integration/targets/utils_fact_diff/tasks/argspec.yaml +++ b/tests/integration/targets/utils_fact_diff/tasks/argspec.yaml @@ -4,7 +4,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: "{{ string in result.msg }}" loop: - "missing required arguments:" @@ -14,7 +14,7 @@ loop_var: string when: "{{result.msg|type_debug != 'list'}}" -- assert: +- ansible.builtin.assert: that: "{{ msg in result.msg }}" vars: msg: "missing required arguments: after, before" @@ -31,10 +31,10 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: "{{ 'unable to convert to list' in result.msg }}" when: "{{result.msg|type_debug != 'list'}}" -- assert: +- ansible.builtin.assert: that: "{{ 'unable to convert to list' in result.msg[0] }}" when: "{{result.msg|type_debug == 'list'}}" diff --git a/tests/integration/targets/utils_fact_diff/tasks/main.yaml b/tests/integration/targets/utils_fact_diff/tasks/main.yaml index 3b21619..cfc8705 100644 --- a/tests/integration/targets/utils_fact_diff/tasks/main.yaml +++ b/tests/integration/targets/utils_fact_diff/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tasks" recurse: false @@ -10,5 +10,5 @@ delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_fact_diff/tasks/simple.yaml b/tests/integration/targets/utils_fact_diff/tasks/simple.yaml index f37d400..ce9d523 100644 --- a/tests/integration/targets/utils_fact_diff/tasks/simple.yaml +++ b/tests/integration/targets/utils_fact_diff/tasks/simple.yaml @@ -10,7 +10,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: "{{ msg in result.msg }}" vars: msg: "The regex '+', is not valid" diff --git a/tests/integration/targets/utils_from_xml/tasks/main.yaml b/tests/integration/targets/utils_from_xml/tasks/main.yaml index 3b21619..cfc8705 100644 --- a/tests/integration/targets/utils_from_xml/tasks/main.yaml +++ b/tests/integration/targets/utils_from_xml/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tasks" recurse: false @@ -10,5 +10,5 @@ delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_from_xml/tasks/simple.yaml b/tests/integration/targets/utils_from_xml/tasks/simple.yaml index ee146b0..282af08 100644 --- a/tests/integration/targets/utils_from_xml/tasks/simple.yaml +++ b/tests/integration/targets/utils_from_xml/tasks/simple.yaml @@ -13,11 +13,11 @@ }, } -- debug: +- ansible.builtin.debug: msg: "{{ data|ansible.utils.from_xml() }}" - name: Integration tests with and without default engine as xmltodict and - assert: + ansible.builtin.assert: that: "{{ output == item.test }}" loop: - test: "{{ data|ansible.utils.from_xml() }}" @@ -33,7 +33,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: "{{ msg in result.msg }}" vars: msg: "Error when using plugin 'from_xml': Input Xml is not valid" diff --git a/tests/integration/targets/utils_get_path/tasks/argspec.yaml b/tests/integration/targets/utils_get_path/tasks/argspec.yaml index d0c0138..c6145f1 100644 --- a/tests/integration/targets/utils_get_path/tasks/argspec.yaml +++ b/tests/integration/targets/utils_get_path/tasks/argspec.yaml @@ -13,7 +13,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: "{{ msg in result.msg }}" vars: msg: "missing required arguments: path" @@ -24,7 +24,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: "{{ item in result.msg }}" loop: - "missing required arguments:" diff --git a/tests/integration/targets/utils_get_path/tasks/main.yaml b/tests/integration/targets/utils_get_path/tasks/main.yaml index 3b21619..cfc8705 100644 --- a/tests/integration/targets/utils_get_path/tasks/main.yaml +++ b/tests/integration/targets/utils_get_path/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tasks" recurse: false @@ -10,5 +10,5 @@ delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_get_path/tasks/simple.yaml b/tests/integration/targets/utils_get_path/tasks/simple.yaml index 359b2db..ea0e468 100644 --- a/tests/integration/targets/utils_get_path/tasks/simple.yaml +++ b/tests/integration/targets/utils_get_path/tasks/simple.yaml @@ -8,7 +8,7 @@ - 1 - name: Simple test filter and lookup - assert: + ansible.builtin.assert: that: "{{ item.result == item.expected }}" loop: - result: "{{ vars|ansible.utils.get_path('a') }}" @@ -48,7 +48,7 @@ - 0 - name: Simple test filter and lookup w/ wantlist - assert: + ansible.builtin.assert: that: "{{ item.result == item.expected }}" loop: - result: "{{ vars|ansible.utils.get_path('a.b.c.d[0]', wantlist=True) }}" diff --git a/tests/integration/targets/utils_index_of/tasks/argspec.yaml b/tests/integration/targets/utils_index_of/tasks/argspec.yaml index 6cf60df..bfc8e41 100644 --- a/tests/integration/targets/utils_index_of/tasks/argspec.yaml +++ b/tests/integration/targets/utils_index_of/tasks/argspec.yaml @@ -17,7 +17,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: "{{ msg in result.msg }}" vars: msg: "cannot be converted to a list" @@ -28,7 +28,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: "{{ msg in result.msg }}" vars: msg: "missing required arguments: test" @@ -39,7 +39,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: "{{ msg in result.msg }}" vars: msg: "cannot be converted to a list" @@ -50,7 +50,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: "{{ item in result.msg }}" loop: - "missing required arguments:" diff --git a/tests/integration/targets/utils_index_of/tasks/examples_filter.yaml b/tests/integration/targets/utils_index_of/tasks/examples_filter.yaml index 9988439..c3a2778 100644 --- a/tests/integration/targets/utils_index_of/tasks/examples_filter.yaml +++ b/tests/integration/targets/utils_index_of/tasks/examples_filter.yaml @@ -37,13 +37,13 @@ # indices: # - 2 -#- name: Find numbers greater than 1, using loop -# debug: -# msg: "{{ data[item] }} is {{ test }} than {{ value }}" -# loop: "{{ data|ansible.utils.index_of(test, value) }}" -# vars: -# test: '>' -# value: 1 +# - name: Find numbers greater than 1, using loop +# ansible.builtin.debug: +# msg: "{{ data[item] }} is {{ test }} than {{ value }}" +# loop: "{{ data|ansible.utils.index_of(test, value) }}" +# vars: +# test: '>' +# value: 1 # TASK [Find numbers great than 1, using loop] ******************************* # ok: [sw01] => (item=1) => @@ -76,7 +76,7 @@ # - 3 - name: Find the index of all firewalls, use in a loop - debug: + ansible.builtin.debug: msg: "The type of {{ device_type }} at index {{ item }} has name {{ data[item].name }}." loop: "{{ data|ansible.utils.index_of('eq', device_type, 'type') }}" vars: @@ -89,7 +89,7 @@ # msg: The type of firewall at index 3 has name fw02.example.corp. - name: Find the index of all devices with a .corp name - debug: + ansible.builtin.debug: msg: "The device named {{ data[item].name }} is a {{ data[item].type }}" loop: "{{ data|ansible.utils.index_of('regex', expression, 'name') }}" vars: @@ -140,7 +140,7 @@ # interface_idx: '128' # - name: Show all interfaces and their address -# debug: +# ansible.builtin.debug: # msg: "{{ interface.name }} has ip {{ address }}" # loop: "{{ found|subelements('address_idxs') }}" # vars: @@ -199,7 +199,7 @@ index: 3 - name: Find the description of loopback111, subinterface index 10 - debug: + ansible.builtin.debug: msg: |- {{ data.interfaces.interface[int_idx|int] .subinterfaces.subinterface[subint_idx|int] diff --git a/tests/integration/targets/utils_index_of/tasks/examples_lookup.yaml b/tests/integration/targets/utils_index_of/tasks/examples_lookup.yaml index 653895e..586baf8 100644 --- a/tests/integration/targets/utils_index_of/tasks/examples_lookup.yaml +++ b/tests/integration/targets/utils_index_of/tasks/examples_lookup.yaml @@ -38,7 +38,7 @@ # - 2 #- name: Find numbers greater than 1, using loop -# debug: +# ansible.builtin.debug: # msg: "{{ data[item] }} is {{ test }} than {{ value }}" # loop: "{{ lookup('ansible.utils.index_of', data, test, value) }}" # vars: @@ -52,7 +52,7 @@ # msg: 3 is > than 1 - name: Find numbers greater than 1, using with - debug: + ansible.builtin.debug: msg: "{{ data[item] }} is {{ params.test }} than {{ params.value }}" with_ansible.utils.index_of: "{{ params }}" vars: @@ -92,7 +92,7 @@ # - 3 - name: Find the index of all firewalls, use in a loop - debug: + ansible.builtin.debug: msg: "The type of {{ device_type }} at index {{ item }} has name {{ data[item].name }}." loop: "{{ lookup('ansible.utils.index_of', data, 'eq', device_type, 'type') }}" vars: @@ -105,7 +105,7 @@ # msg: The type of firewall at index 3 has name fw02.example.corp. - name: Find the index of all devices with a .corp name - debug: + ansible.builtin.debug: msg: "The device named {{ data[item].name }} is a {{ data[item].type }}" loop: "{{ lookup('ansible.utils.index_of', data, 'regex', expression, 'name') }}" vars: @@ -215,7 +215,7 @@ index: 3 - name: Find the description of loopback111, subinterface index 10 - debug: + ansible.builtin.debug: msg: |- {{ data.interfaces.interface[int_idx|int] .subinterfaces.subinterface[subint_idx|int] diff --git a/tests/integration/targets/utils_index_of/tasks/main.yaml b/tests/integration/targets/utils_index_of/tasks/main.yaml index 3b21619..cfc8705 100644 --- a/tests/integration/targets/utils_index_of/tasks/main.yaml +++ b/tests/integration/targets/utils_index_of/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tasks" recurse: false @@ -10,5 +10,5 @@ delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_index_of/tasks/simple.yaml b/tests/integration/targets/utils_index_of/tasks/simple.yaml index 589742c..9a3b36d 100644 --- a/tests/integration/targets/utils_index_of/tasks/simple.yaml +++ b/tests/integration/targets/utils_index_of/tasks/simple.yaml @@ -24,7 +24,7 @@ - b - name: Some basic tests - assert: + ansible.builtin.assert: that: "{{ item.test == item.result }}" loop: - test: "{{ complex.a|ansible.utils.index_of('eq', True) }}" @@ -70,7 +70,7 @@ e1: redhat - name: Find index in list of dictionaries - assert: + ansible.builtin.assert: that: "{{ item.test == item.result }}" loop: - test: "{{ complex.a.b.c.d|ansible.utils.index_of('eq', 'ansible', 'e1') }}" @@ -83,7 +83,7 @@ result: [0] - name: Test a missing key in the list of dictionaries - assert: + ansible.builtin.assert: that: "{{ item.test == item.result }}" loop: - test: "{{ complex.a.b.c.d|ansible.utils.index_of('eq', True, 'e2') }}" @@ -92,7 +92,7 @@ result: "0" - name: Test a missing key in the list of dictionaries, fail on missing - assert: + ansible.builtin.assert: that: "{{ item.test == item.result }}" loop: - test: "{{ complex.a.b.c.d|ansible.utils.index_of('eq', True, 'e2', fail_on_missing=True) }}" @@ -103,5 +103,5 @@ register: result - name: Ensure the previous test failed - assert: + ansible.builtin.assert: that: "{{ result.failed and 'not found in' in result.msg }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/cidr_merge.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/cidr_merge.yaml index 18b0bec..52c9066 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/cidr_merge.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/cidr_merge.yaml @@ -11,7 +11,7 @@ result1: "{{ value|ansible.utils.cidr_merge }}" - name: Assert result for cidr_merge - assert: + ansible.builtin.assert: that: "{{ result1 == cidr_result1 }}" - name: cidr_merge with span action @@ -27,5 +27,5 @@ result2: "{{ value|ansible.utils.cidr_merge('span') }}" - name: Assert result for cidr_merge(span) - assert: + ansible.builtin.assert: that: "{{ result2 == cidr_result2 }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/hwaddr.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/hwaddr.yaml index df5a3c3..5285a8c 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/hwaddr.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/hwaddr.yaml @@ -4,7 +4,7 @@ result1: "{{ '1a:2b:3c:4d:5e:6f'|ansible.utils.hwaddr }}" - name: Assert result for hwaddr. - assert: + ansible.builtin.assert: that: "{{ result1 == '1a:2b:3c:4d:5e:6f' }}" - name: hwaddr filter test2 @@ -12,5 +12,5 @@ result1: "{{ '1a:2b:3c:4d:5e:6f'|ansible.utils.hwaddr('cisco') }}" - name: Assert result for hwaddr. - assert: + ansible.builtin.assert: that: "{{ result1 == '1a2b.3c4d.5e6f' }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/ip4_hex.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/ip4_hex.yaml index 0fd613b..8defaa1 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/ip4_hex.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/ip4_hex.yaml @@ -4,7 +4,7 @@ result1: "{{ '192.168.1.5'|ansible.utils.ip4_hex }}" - name: Assert result for ip4_hex. - assert: + ansible.builtin.assert: that: "{{ result1 == 'c0a80105' }}" - name: ip4_hex with delimiter @@ -12,5 +12,5 @@ result1: "{{ '192.168.1.5'|ansible.utils.ip4_hex(':') }}" - name: Assert result for ip4_hex. - assert: + ansible.builtin.assert: that: "{{ result1 == 'c0:a8:01:05' }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/ipaddr.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/ipaddr.yaml index 3c89310..c00d8ba 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/ipaddr.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/ipaddr.yaml @@ -15,7 +15,7 @@ result1: "{{ value|ansible.utils.ipaddr }}" - name: Assert result for ipaddr. - assert: + ansible.builtin.assert: that: "{{ result1 == ipaddr_result1 }}" - name: ipaddr filter with host string query @@ -23,7 +23,7 @@ result2: "{{ value|ansible.utils.ipaddr('host') }}" - name: Assert result for ipaddr host query - assert: + ansible.builtin.assert: that: "{{ result2 == ipaddr_result2 }}" - name: ipaddr filter with public network query @@ -31,7 +31,7 @@ result3: "{{ value|ansible.utils.ipaddr('public') }}" - name: Assert result for ipaddr public network query - assert: + ansible.builtin.assert: that: "{{ result3== ipaddr_result3 }}" - name: ipaddr filter with network query @@ -39,7 +39,7 @@ result4: "{{ value|ansible.utils.ipaddr('net') }}" - name: Assert result for ipaddr network query - assert: + ansible.builtin.assert: that: "{{ result4 == ipaddr_result4 }}" - name: ipaddr filter with network/prefix query @@ -47,7 +47,7 @@ result5: "{{ '192.168.0.0/23' | ansible.utils.ipaddr('network/prefix') }}" - name: Assert result for ipaddr filter with network/prefix query - assert: + ansible.builtin.assert: that: "{{ result5 == '192.168.0.0/23' }}" - name: ipaddr filter with chained filters @@ -55,20 +55,20 @@ result6: "{{ '192.168.255.0' | ansible.utils.ipaddr('network') | ansible.utils.ipmath(123) }}" - name: Assert result for ipaddr filter with chained filters - assert: + ansible.builtin.assert: that: "{{ result6 == '192.168.255.123' }}" -- debug: +- ansible.builtin.debug: msg: "Test int input for ipaddr filter" - name: set fact 1 - set_fact: + ansible.builtin.set_fact: ip1: "172.20.0.1" - name: Set fact 2 - set_fact: + ansible.builtin.set_fact: ip2: "{{ ((ip1 | ansible.utils.ipaddr('int')) + 6) | ansible.utils.ipaddr }}" - name: Assert result for ipaddr filter - assert: + ansible.builtin.assert: that: "{{ ip2 == '172.20.0.7' }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/ipmath.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/ipmath.yaml index 0aefcc1..4990c03 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/ipmath.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/ipmath.yaml @@ -4,7 +4,7 @@ result1: "{{ '192.168.1.5'|ansible.utils.ipmath('5') }}" - name: Assert result for ipmath. - assert: + ansible.builtin.assert: that: "{{ result1 == '192.168.1.10' }}" - name: Get the tenth previous address based on an IP address with Ipmath filter @@ -12,7 +12,7 @@ result1: "{{ '192.168.1.5'|ansible.utils.ipmath('-10') }}" - name: Assert result for ipmath. - assert: + ansible.builtin.assert: that: "{{ result1 == '192.168.0.251' }}" - name: Get the next fifth address using CIDR notation with Ipmath filter @@ -20,7 +20,7 @@ result1: "{{ '192.168.1.1/24'|ansible.utils.ipmath('5') }}" - name: Assert result for ipmath. - assert: + ansible.builtin.assert: that: "{{ result1 == '192.168.1.6' }}" - name: Get the previous fifth address using CIDR notation with Ipmath filter @@ -28,7 +28,7 @@ result1: "{{ '192.168.1.6/24'|ansible.utils.ipmath('-5') }}" - name: Assert result for ipmath. - assert: + ansible.builtin.assert: that: "{{ result1 == '192.168.1.1' }}" - name: Get the next tenth address in IPv6 with Ipmath filter @@ -36,7 +36,7 @@ result1: "{{ '2001::1'|ansible.utils.ipmath('10') }}" - name: Assert result for ipmath. - assert: + ansible.builtin.assert: that: "{{ result1 == '2001::b' }}" - name: Get the previous tenth address in IPv6 with Ipmath filter @@ -44,5 +44,5 @@ result1: "{{ '2001::5'|ansible.utils.ipmath('-10') }}" - name: Assert result for ipmath. - assert: + ansible.builtin.assert: that: "{{ result1 == '2000:ffff:ffff:ffff:ffff:ffff:ffff:fffb' }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/ipsubnet.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/ipsubnet.yaml index 76740d3..7dc7ec3 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/ipsubnet.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/ipsubnet.yaml @@ -4,7 +4,7 @@ result1: "{{ address | ansible.utils.ipsubnet }}" - name: Assert result for ipsubnet. - assert: + ansible.builtin.assert: that: "{{ result1 == '192.168.144.5/32' }}" - name: check if given value is subnet @@ -12,7 +12,7 @@ result2: "{{ subnet | ansible.utils.ipsubnet }}" - name: Assert result for ipsubnet. - assert: + ansible.builtin.assert: that: "{{ result2 == '192.168.0.0/16' }}" - name: Get the number of subnets a given subnet can be split into @@ -20,7 +20,7 @@ result3: "{{ subnet | ansible.utils.ipsubnet('20') }}" - name: Assert result for ipsubnet. - assert: + ansible.builtin.assert: that: "{{ result3 == '16' }}" - name: Get the 1st subnet @@ -28,7 +28,7 @@ result4: "{{ subnet | ansible.utils.ipsubnet('20', '0') }}" - name: Assert result for ipsubnet. - assert: + ansible.builtin.assert: that: "{{ result4 == '192.168.0.0/20' }}" - name: Get the last subnet @@ -36,7 +36,7 @@ result5: "{{ subnet | ansible.utils.ipsubnet('20', '-1') }}" - name: Assert result for ipsubnet. - assert: + ansible.builtin.assert: that: "{{ result5 == '192.168.240.0/20' }}" - name: Get biggest subnet that contains that given IP address @@ -44,7 +44,7 @@ result6: "{{ address | ansible.utils.ipsubnet('20') }}" - name: Assert result for ipsubnet. - assert: + ansible.builtin.assert: that: "{{ result6 == '192.168.144.0/20' }}" - name: Get the 1st subnet @@ -52,7 +52,7 @@ result7: "{{ address | ansible.utils.ipsubnet('18', '0') }}" - name: Assert result for ipsubnet. - assert: + ansible.builtin.assert: that: "{{ result7 == '192.168.128.0/18' }}" - name: The rank of the IP in the subnet (the IP is the 36870nth /32 of the subnet) @@ -60,7 +60,7 @@ result8: "{{ address | ansible.utils.ipsubnet(subnet) }}" - name: Assert result for ipsubnet. - assert: + ansible.builtin.assert: that: "{{ result8 == '36870' }}" - name: Small subnets from a large supernet should return quickly @@ -68,7 +68,7 @@ result9: "{{ '2001:db8::/56' | ansible.utils.ipsubnet(120, 0) }}" - name: Assert result for ipsubnet. - assert: + ansible.builtin.assert: that: result9 == '2001:db8::/120' - name: Small subnets from a large supernet should return quickly at index @@ -76,5 +76,5 @@ result10: "{{ '2001:db8::/56' | ansible.utils.ipsubnet(120, 4) }}" - name: Assert result for ipsubnet. - assert: + ansible.builtin.assert: that: result10 == '2001:db8::400/120' diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/ipv4.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/ipv4.yaml index b227600..0805dd3 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/ipv4.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/ipv4.yaml @@ -15,7 +15,7 @@ result1: "{{ value|ansible.utils.ipv4 }}" - name: Assert result for ipv4. - assert: + ansible.builtin.assert: that: "{{ result1 == result1_val }}" - name: convert ipv4 to ipv6 filter @@ -23,7 +23,7 @@ result2: "{{ value|ansible.utils.ipv4('ipv6') }}" - name: Assert result for ipv6. - assert: + ansible.builtin.assert: that: "{{ result2 == result2_val }}" - name: Ipv4 filter with address query @@ -31,7 +31,7 @@ result3: "{{ value|ansible.utils.ipv4('address') }}" - name: Assert result for ipv4 filter with address query. - assert: + ansible.builtin.assert: that: "{{ result3 == result3_val }}" - name: ipv4 filter with single value @@ -39,5 +39,5 @@ result4: "{{ '192.24.2.1' | ansible.utils.ipv4('ipv6') }}" - name: Assert result for ipv4 filter with single value - assert: + ansible.builtin.assert: that: "{{ result4 == '::ffff:192.24.2.1/128' }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/ipv6.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/ipv6.yaml index f936007..397a651 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/ipv6.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/ipv6.yaml @@ -15,7 +15,7 @@ result1: "{{ value|ansible.utils.ipv6 }}" - name: Assert result for ipv6. - assert: + ansible.builtin.assert: that: "{{ result1 == ipv6_result1 }}" - name: convert ipv6 to ipv4 filter @@ -23,7 +23,7 @@ result2: "{{ value|ansible.utils.ipv6('ipv4') }}" - name: Assert result for ipv4. - assert: + ansible.builtin.assert: that: "{{ result2 == ipv6_result2 }}" - name: Ipv6 filter with address query @@ -31,7 +31,7 @@ result3: "{{ value|ansible.utils.ipv6('address') }}" - name: Assert result for ipv6 filter with address query. - assert: + ansible.builtin.assert: that: "{{ result3 == ipv6_result3 }}" - name: ipv6 filter with single value @@ -39,5 +39,5 @@ result4: "{{ '::ffff:192.168.32.0/120' | ansible.utils.ipv6('ipv4') }}" - name: Assert result for ipv6 filter with single value - assert: + ansible.builtin.assert: that: "{{ result4 == '192.168.32.0/24' }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/ipwrap.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/ipwrap.yaml index 2cda66f..e51226d 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/ipwrap.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/ipwrap.yaml @@ -15,7 +15,7 @@ result1: "{{ value|ansible.utils.ipwrap }}" - name: Assert result for ipwrap. - assert: + ansible.builtin.assert: that: "{{ result1 == ipwrap_result1 }}" - name: ipwrap filter with single value @@ -23,5 +23,5 @@ result4: "{{ 'fe80::100/10' | ansible.utils.ipwrap }}" - name: Assert result for ipv6 filter with single value - assert: + ansible.builtin.assert: that: "{{ result4 == '[fe80::100]/10' }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/macaddr.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/macaddr.yaml index 85e9d82..dc48ea8 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/macaddr.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/macaddr.yaml @@ -4,7 +4,7 @@ result1: "{{ '1a:2b:3c:4d:5e:6f'|ansible.utils.macaddr }}" - name: Assert result for macaddr. - assert: + ansible.builtin.assert: that: "{{ result1 == '1a:2b:3c:4d:5e:6f' }}" - name: macaddr filter test2 @@ -12,5 +12,5 @@ result1: "{{ '1a:2b:3c:4d:5e:6f'|ansible.utils.macaddr('cisco') }}" - name: Assert result for macaddr. - assert: + ansible.builtin.assert: that: "{{ result1 == '1a2b.3c4d.5e6f' }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/main.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/main.yaml index 3b21619..cfc8705 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/main.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tasks" recurse: false @@ -10,5 +10,5 @@ delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/network_in_network.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/network_in_network.yaml index 8611700..ffc36fe 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/network_in_network.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/network_in_network.yaml @@ -4,7 +4,7 @@ result1: "{{ '192.168.0.0/24'|ansible.utils.network_in_network('192.168.0.1') }}" - name: Assert result for network_in_network. - assert: + ansible.builtin.assert: that: "{{ result1 == True }}" - name: network_in_network filter test2 @@ -12,7 +12,7 @@ result1: "{{ '192.168.0.0/24'|ansible.utils.network_in_network('10.0.0.1') }}" - name: Assert result for network_in_network - assert: + ansible.builtin.assert: that: "{{ result1 == False }}" - name: network_in_network filter test3 @@ -20,5 +20,5 @@ result1: "{{ '192.168.0.0/16'|ansible.utils.network_in_network('192.168.0.0/24') }}" - name: Assert result for network_in_network - assert: + ansible.builtin.assert: that: "{{ result1 == True }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/network_in_usable.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/network_in_usable.yaml index 47973c2..de55363 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/network_in_usable.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/network_in_usable.yaml @@ -4,7 +4,7 @@ result1: "{{ '192.168.0.0/24'|ansible.utils.network_in_usable('192.168.0.1') }}" - name: Assert result for network_in_usable. - assert: + ansible.builtin.assert: that: "{{ result1 == True }}" - name: network_in_usable filter test2 @@ -12,7 +12,7 @@ result1: "{{ '192.168.0.0/24'|ansible.utils.network_in_usable('192.168.0.255') }}" - name: Assert result for network_in_usable - assert: + ansible.builtin.assert: that: "{{ result1 == False }}" - name: network_in_usable filter test3 @@ -20,5 +20,5 @@ result1: "{{ '192.168.0.0/16'|ansible.utils.network_in_usable('192.168.0.255') }}" - name: Assert result for network_in_usable - assert: + ansible.builtin.assert: that: "{{ result1 == True }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/next_nth_usable.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/next_nth_usable.yaml index ad15b70..8c82fe0 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/next_nth_usable.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/next_nth_usable.yaml @@ -4,7 +4,7 @@ result1: "{{ '192.168.122.1/24'|ansible.utils.next_nth_usable(2) }}" - name: Assert result for next_nth_usable. - assert: + ansible.builtin.assert: that: "{{ result1 == '192.168.122.3' }}" - name: next_nth_usable filter @@ -12,5 +12,5 @@ result1: "{{ '192.168.122.254/24'|ansible.utils.next_nth_usable(2) }}" - name: Assert result for ipv4. - assert: + ansible.builtin.assert: that: "{{ result1 == '' }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/nthhost.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/nthhost.yaml index 09fc90e..d6df041 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/nthhost.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/nthhost.yaml @@ -4,7 +4,7 @@ result1: "{{ '10.0.0.0/8'|ansible.utils.nthhost(305) }}" - name: Assert result for nthhost. - assert: + ansible.builtin.assert: that: "{{ result1 == '10.0.1.49' }}" - name: nthhost filter test2 @@ -12,5 +12,5 @@ result1: "{{ '10.0.0.0/8'|ansible.utils.nthhost(-1) }}" - name: Assert result for nthhost - assert: + ansible.builtin.assert: that: "{{ result1 == '10.255.255.255' }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/previous_nth_usable.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/previous_nth_usable.yaml index 7da5c36..f4035a7 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/previous_nth_usable.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/previous_nth_usable.yaml @@ -4,7 +4,7 @@ result1: "{{ '192.168.122.10/24'|ansible.utils.previous_nth_usable(2) }}" - name: Assert result for previous_nth_usable. - assert: + ansible.builtin.assert: that: "{{ result1 == '192.168.122.8' }}" - name: previous_nth_usable filter @@ -12,5 +12,5 @@ result1: "{{ '192.168.122.1/24'|ansible.utils.previous_nth_usable(2) }}" - name: Assert result for ipv4. - assert: + ansible.builtin.assert: that: "{{ result1 == '' }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/reduce_on_network.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/reduce_on_network.yaml index db41dd1..ab8431f 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/reduce_on_network.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/reduce_on_network.yaml @@ -4,5 +4,5 @@ result1: "{{ ['192.168.0.34', '10.3.0.3', '192.168.2.34'] |ansible.utils.reduce_on_network('192.168.0.0/24') }}" - name: Assert result for reduce_on_network. - assert: + ansible.builtin.assert: that: "{{ result1 == ['192.168.0.34'] }}" diff --git a/tests/integration/targets/utils_ipaddr_filter/tasks/slaac.yaml b/tests/integration/targets/utils_ipaddr_filter/tasks/slaac.yaml index e86399d..fa6fb01 100644 --- a/tests/integration/targets/utils_ipaddr_filter/tasks/slaac.yaml +++ b/tests/integration/targets/utils_ipaddr_filter/tasks/slaac.yaml @@ -4,5 +4,5 @@ result1: "{{ 'fdcf:1894:23b5:d38c:0000:0000:0000:0000'|ansible.utils.slaac('c2:31:b3:83:bf:2b') }}" - name: Assert result for slaac. - assert: + ansible.builtin.assert: that: "{{ result1 == 'fdcf:1894:23b5:d38c:c031:b3ff:fe83:bf2b' }}" diff --git a/tests/integration/targets/utils_keep_keys/tasks/main.yaml b/tests/integration/targets/utils_keep_keys/tasks/main.yaml index 3b21619..cfc8705 100644 --- a/tests/integration/targets/utils_keep_keys/tasks/main.yaml +++ b/tests/integration/targets/utils_keep_keys/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tasks" recurse: false @@ -10,5 +10,5 @@ delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_keep_keys/tasks/simple.yaml b/tests/integration/targets/utils_keep_keys/tasks/simple.yaml index 8c703e8..4681686 100644 --- a/tests/integration/targets/utils_keep_keys/tasks/simple.yaml +++ b/tests/integration/targets/utils_keep_keys/tasks/simple.yaml @@ -25,12 +25,12 @@ mtu: 600 is_enabled: false -- debug: +- ansible.builtin.debug: msg: "{{ data|ansible.utils.keep_keys(target=['desc', 'interface_'], matching_parameter= 'starts_with') }}" register: result - name: Assert result dicts - assert: + ansible.builtin.assert: that: - keep['starts_with'] == result['msg'] @@ -60,11 +60,11 @@ mtu: 600 is_enabled: false -- debug: +- ansible.builtin.debug: msg: "{{ data|ansible.utils.keep_keys(target=['interface_name', 'is_enabled', 'vlan_id']) }}" register: result - name: Assert result dicts - assert: + ansible.builtin.assert: that: - keep_default['default'] == result['msg'] diff --git a/tests/integration/targets/utils_netaddr_test/tasks/in_any_network.yml b/tests/integration/targets/utils_netaddr_test/tasks/in_any_network.yml index 0c69b04..7a65d9c 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/in_any_network.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/in_any_network.yml @@ -1,11 +1,11 @@ --- - name: "in_any_network: :Check if 10.1.1.1 is in the provided network list" - assert: + ansible.builtin.assert: that: - "{{ '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" - assert: + ansible.builtin.assert: that: "{{ '8.8.8.8' is not ansible.utils.in_any_network networks }}" - name: "in_any_network: Test invalidness" @@ -13,5 +13,5 @@ criteria_check: "{{ '192.168.4.56' is ansible.utils.in_any_network networks }}" - name: "in_any_network: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/in_network.yml b/tests/integration/targets/utils_netaddr_test/tasks/in_network.yml index 256df7b..74c7536 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/in_network.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/in_network.yml @@ -1,10 +1,10 @@ --- - name: "in_network: Check if 10.1.1.1 is in 10.0.0.0/8" - assert: + ansible.builtin.assert: 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" - assert: + ansible.builtin.assert: that: "{{ '10.1.1.1' is not ansible.utils.in_network '192.168.1.0/24' }}" - name: "in_network: Test invalidness" @@ -12,15 +12,15 @@ criteria_check1: "{{ '8.8.8.8' is ansible.utils.in_network '10.0.0.0/8' }}" - name: "in_network: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "in_network: Check if 2001:db8:a::123 is in 2001:db8:a::/64" - assert: + ansible.builtin.assert: 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" - assert: + ansible.builtin.assert: that: "{{ '2001:db8:a::123' is not ansible.utils.in_network '10.0.0.0/8' }}" - name: "in_network: Test invalidness" @@ -28,5 +28,5 @@ criteria_check2: "{{ '2001:db8:a::123' is not ansible.utils.in_network '2001:db8:a::/64' }}" - name: "in_network: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/in_one_network.yml b/tests/integration/targets/utils_netaddr_test/tasks/in_one_network.yml index cb08c35..9f2d0a8 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/in_one_network.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/in_one_network.yml @@ -1,10 +1,10 @@ --- - name: "in_one_network: Check if 10.1.1.1 is in the provided network list" - assert: + ansible.builtin.assert: 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" - assert: + ansible.builtin.assert: that: "{{ '192.168.3.5' is not ansible.utils.in_one_network networks }}" - name: "in_one_network: Test invalidness" @@ -12,5 +12,5 @@ criteria_check: "{{ '172.168.2.16' is ansible.utils.in_one_network networks }}" - name: "in_one_network: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/ip.yml b/tests/integration/targets/utils_netaddr_test/tasks/ip.yml index 11b76bd..722b913 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/ip.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/ip.yml @@ -1,14 +1,14 @@ --- - name: "ip: Check if 10.1.1.1 is a valid IP address" - assert: + ansible.builtin.assert: that: "{{ '10.1.1.1' is ansible.utils.ip }}" - name: "ip: Check if 2001:db8:a::123 is a valid IP address" - assert: + ansible.builtin.assert: that: "{{ '2001:db8:a::123' is ansible.utils.ip }}" - name: "ip: Check if 10.0.0.0/8 is a valid IP address" - assert: + ansible.builtin.assert: that: "{{ '10.0.0.0/8' is ansible.utils.ip }}" - name: "ip: Test invalidness" @@ -16,7 +16,7 @@ criteria_check1: "{{ 'string' is ansible.utils.ip }}" - name: "ip: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "ip: Test invalidness" @@ -24,5 +24,5 @@ criteria_check2: "{{ '300.1.1.1' is ansible.utils.ip }}" - name: "ip: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/ip_address.yml b/tests/integration/targets/utils_netaddr_test/tasks/ip_address.yml index b92da2a..bf6e1bb 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/ip_address.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/ip_address.yml @@ -1,10 +1,10 @@ --- - name: "ip_address: Check if 10.1.1.1 is a valid IP address" - assert: + ansible.builtin.assert: that: "{{ '10.1.1.1' is ansible.utils.ip_address }}" - name: "ip_address: Check if 2001:db8:a::123 is a valid IP address" - assert: + ansible.builtin.assert: that: "{{ '2001:db8:a::123' is ansible.utils.ip_address }}" - name: "ip_address: Test invalidness" @@ -12,7 +12,7 @@ criteria_check1: "{{ '10.0.0.0/8' is ansible.utils.ip_address }}" - name: "ip_address: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "ip_address: Test invalidness" @@ -20,7 +20,7 @@ criteria_check2: "{{ 'string' is ansible.utils.ip_address }}" - name: "ip_address: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" - name: "ip_address: Test invalidness" @@ -28,5 +28,5 @@ criteria_check3: "{{ '300.1.1.1' is ansible.utils.ip_address }}" - name: "ip_address: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check3 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/ipv4.yml b/tests/integration/targets/utils_netaddr_test/tasks/ipv4.yml index dd8633c..b9b3702 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/ipv4.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/ipv4.yml @@ -1,10 +1,10 @@ --- - name: "ipv4: Check if 10.0.0.0/8 is a valid IPV4 address" - assert: + ansible.builtin.assert: that: "{{ '10.0.0.0/8' is ansible.utils.ipv4 }}" - name: "ipv4: Check if 192.168.1.250 is a valid IPV4 address" - assert: + ansible.builtin.assert: that: "{{ '192.168.1.250' is ansible.utils.ipv4 }}" - name: "ipv4: Test invalidness" @@ -12,7 +12,7 @@ criteria_check1: "{{ 'fe80::216:3eff:fee4:16f3' is ansible.utils.ipv4 }}" - name: "ipv4: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "ipv4: Test invalidness" @@ -20,5 +20,5 @@ criteria_check2: "{{ 'string' is ansible.utils.ipv4 }}" - name: "ipv4: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/ipv4_address.yml b/tests/integration/targets/utils_netaddr_test/tasks/ipv4_address.yml index 1ebfbf5..0259215 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/ipv4_address.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/ipv4_address.yml @@ -1,6 +1,6 @@ --- - name: "ipv4_address: Check if 192.168.1.250 is a valid IPV4 address" - assert: + ansible.builtin.assert: that: "{{ '192.168.1.250' is ansible.utils.ipv4_address }}" - name: "ipv4_address: Test invalidness" @@ -8,7 +8,7 @@ criteria_check1: "{{ '10.0.0.0/8' is ansible.utils.ipv4_address }}" - name: "ipv4_address: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "ipv4_address: Test invalidness" @@ -16,7 +16,7 @@ criteria_check2: "{{ 'fe80::216:3eff:fee4:16f3' is ansible.utils.ipv4_address }}" - name: "ipv4_address: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" - name: "ipv4_address: Test invalidness" @@ -24,5 +24,5 @@ criteria_check3: "{{ 'string' is ansible.utils.ipv4_address }}" - name: "ipv4_address: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check3 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/ipv4_hostmask.yml b/tests/integration/targets/utils_netaddr_test/tasks/ipv4_hostmask.yml index 6252826..17a3bcf 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/ipv4_hostmask.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/ipv4_hostmask.yml @@ -1,6 +1,6 @@ --- - name: "ipv4_hostmask: Check if 0.0.0.255 is a hostmask" - assert: + ansible.builtin.assert: that: "{{ '0.0.0.255' is ansible.utils.ipv4_hostmask }}" - name: "ipv4_hostmask: Test invalidness" @@ -8,7 +8,7 @@ criteria_check1: "{{ '255.255.255.0' is ansible.utils.ipv4_hostmask }}" - name: "ipv4_hostmask: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "ipv4_hostmask: Test invalidness" @@ -16,5 +16,5 @@ criteria_check2: "{{ '10.1.1.1' is ansible.utils.ipv4_hostmask }}" - name: "ipv4_hostmask: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/ipv4_netmask.yml b/tests/integration/targets/utils_netaddr_test/tasks/ipv4_netmask.yml index eb51fb7..5aa8c45 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/ipv4_netmask.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/ipv4_netmask.yml @@ -1,6 +1,6 @@ --- - name: "ipv4_netmask: Check if 255.255.255.0 is a netmask" - assert: + ansible.builtin.assert: that: "{{ '255.255.255.0' is ansible.utils.ipv4_netmask }}" - name: "ipv4_netmask: Test invalidness" @@ -8,7 +8,7 @@ criteria_check1: "{{ '0.0.0.255' is ansible.utils.ipv4_netmask }}" - name: "ipv4_netmask: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "ipv4_netmask: Test invalidness" @@ -16,5 +16,5 @@ criteria_check2: "{{ '10.1.1.1' is ansible.utils.ipv4_netmask }}" - name: "ipv4_netmask: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/ipv6.yml b/tests/integration/targets/utils_netaddr_test/tasks/ipv6.yml index 02defa2..814374a 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/ipv6.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/ipv6.yml @@ -1,10 +1,10 @@ --- - name: "ipv6: Check if fe80::216:3eff:fee4:16f3 is a valid IPV6 address" - assert: + ansible.builtin.assert: that: "{{ 'fe80::216:3eff:fee4:16f3' is ansible.utils.ipv6 }}" - name: "ipv6: Check if 2001:db8:a::/64 is a valid IPV6 address" - assert: + ansible.builtin.assert: that: "{{ '2001:db8:a::/64' is ansible.utils.ipv6 }}" - name: "ipv6: Test invalidness" @@ -12,7 +12,7 @@ criteria_check1: "{{ '10.1.1.1' is ansible.utils.ipv6 }}" - name: "ipv6: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "ipv6: Test invalidness" @@ -20,5 +20,5 @@ criteria_check2: "{{ 'string' is ansible.utils.ipv6 }}" - name: "ipv6: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/ipv6_address.yml b/tests/integration/targets/utils_netaddr_test/tasks/ipv6_address.yml index 373d077..a481f5d 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/ipv6_address.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/ipv6_address.yml @@ -1,6 +1,6 @@ --- - name: "ipv6_address: Check if fe80::216:3eff:fee4:16f3 is a valid IPV6 address" - assert: + ansible.builtin.assert: that: "{{ 'fe80::216:3eff:fee4:16f3' is ansible.utils.ipv6_address }}" - name: "ipv6_address: Test invalidness" @@ -8,7 +8,7 @@ criteria_check1: "{{ '2001:db8:a::123/64' is ansible.utils.ipv6_address }}" - name: "ipv6_address: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "ipv6_address: Test invalidness" @@ -16,7 +16,7 @@ criteria_check2: "{{ '192.168.1.250' is ansible.utils.ipv6_address }}" - name: "ipv6_address: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" - name: "ipv6_address: Test invalidness" @@ -24,5 +24,5 @@ criteria_check3: "{{ 'string' is ansible.utils.ipv6_address }}" - name: "ipv6_address: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check3 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/ipv6_ipv4_mapped.yml b/tests/integration/targets/utils_netaddr_test/tasks/ipv6_ipv4_mapped.yml index ea6b627..3508a57 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/ipv6_ipv4_mapped.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/ipv6_ipv4_mapped.yml @@ -1,6 +1,6 @@ --- - name: "ipv6_ipv4_mapped: Check if ::FFFF:10.1.1.1 is a valid IPv4-mapped IPv6 address" - assert: + ansible.builtin.assert: that: "{{ '::FFFF:10.1.1.1' is ansible.utils.ipv6_ipv4_mapped }}" - name: "ipv6_ipv4_mapped: Test invalidness" @@ -8,7 +8,7 @@ criteria_check1: "{{ '::AAAA:10.1.1.1' is ansible.utils.ipv6_ipv4_mapped }}" - name: "ipv6_ipv4_mapped: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "ipv6_ipv4_mapped: Test invalidness" @@ -16,5 +16,5 @@ criteria_check2: "{{ 'hello-world' is ansible.utils.ipv6_ipv4_mapped }}" - name: "ipv6_ipv4_mapped: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/ipv6_sixtofour.yml b/tests/integration/targets/utils_netaddr_test/tasks/ipv6_sixtofour.yml index 4cd6278..6a32496 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/ipv6_sixtofour.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/ipv6_sixtofour.yml @@ -1,6 +1,6 @@ --- - name: "ipv6_sixtofour: Check if 2002:c0a8:6301:1::1 is a valid 6to4 address" - assert: + ansible.builtin.assert: that: "{{ '2002:c0a8:6301:1::1' is ansible.utils.ipv6_sixtofour }}" - name: "ipv6_sixtofour: Test invalidness" @@ -8,7 +8,7 @@ criteria_check1: "{{ '2001:c0a8:6301:1::1' is ansible.utils.ipv6_sixtofour }}" - name: "ipv6_sixtofour: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "ipv6_sixtofour: Test invalidness" @@ -16,5 +16,5 @@ criteria_check2: "{{ 'helloworld' is ansible.utils.ipv6_sixtofour }}" - name: "ipv6_sixtofour: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/ipv6_teredo.yml b/tests/integration/targets/utils_netaddr_test/tasks/ipv6_teredo.yml index 9f8bd49..998fb6f 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/ipv6_teredo.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/ipv6_teredo.yml @@ -1,6 +1,6 @@ --- - name: "ipv6_teredo: Check if 2001::c0a8:6301:1 is a valid 6to4 address" - assert: + ansible.builtin.assert: that: "{{ '2001::c0a8:6301:1' is ansible.utils.ipv6_teredo }}" - name: "ipv6_teredo: Test invalidness" @@ -8,7 +8,7 @@ criteria_check1: "{{ '2002::c0a8:6301:1' is ansible.utils.ipv6_teredo }}" - name: "ipv6_teredo: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "ipv6_teredo: Test invalidness" @@ -16,5 +16,5 @@ criteria_check2: "{{ 'helloworld' is ansible.utils.ipv6_teredo }}" - name: "ipv6_teredo: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/loopback.yml b/tests/integration/targets/utils_netaddr_test/tasks/loopback.yml index 40802a1..bc9b80c 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/loopback.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/loopback.yml @@ -1,10 +1,10 @@ --- - name: "loopback: Check if 127.10.10.10 is a valid loopback address" - assert: + ansible.builtin.assert: that: "{{ '127.10.10.10' is ansible.utils.loopback }}" - name: "loopback: Check if ::1 is a valid loopback address" - assert: + ansible.builtin.assert: that: "{{ '::1' is ansible.utils.loopback }}" - name: "loopback: Test invalidness" @@ -12,5 +12,5 @@ criteria_check: "{{ '10.1.1.1' is ansible.utils.loopback }}" - name: "loopback: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/mac.yml b/tests/integration/targets/utils_netaddr_test/tasks/mac.yml index 96f6da4..d83ab89 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/mac.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/mac.yml @@ -1,18 +1,18 @@ --- - name: "mac: Check if 02:16:3e:e4:16:f3 is a valid MAC address" - assert: + ansible.builtin.assert: 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" - assert: + ansible.builtin.assert: that: "{{ '02-16-3e-e4-16-f3' is ansible.utils.mac }}" - name: "mac: Check if 0216.3ee4.16f3 is a valid MAC address" - assert: + ansible.builtin.assert: that: "{{ '0216.3ee4.16f3' is ansible.utils.mac }}" - name: "mac: Check if 02163ee416f3 is a valid MAC address" - assert: + ansible.builtin.assert: that: "{{ '02163ee416f3' is ansible.utils.mac }}" - name: "mac: Check invalidness" @@ -20,5 +20,5 @@ criteria_check: "{{ 'string' is ansible.utils.mac }}" - name: "mac: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/main.yaml b/tests/integration/targets/utils_netaddr_test/tasks/main.yaml index 3b21619..cfc8705 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/main.yaml +++ b/tests/integration/targets/utils_netaddr_test/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tasks" recurse: false @@ -10,5 +10,5 @@ delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/multicast.yml b/tests/integration/targets/utils_netaddr_test/tasks/multicast.yml index 2b9a39b..abb0484 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/multicast.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/multicast.yml @@ -1,10 +1,10 @@ --- - name: "multicast: Check if 224.0.0.1 is a valid multicast IP address" - assert: + ansible.builtin.assert: that: "{{ '224.0.0.1' is ansible.utils.multicast }}" - name: "multicast: Check if ff02::1 is a valid multicast IP address" - assert: + ansible.builtin.assert: that: "{{ 'ff02::1' is ansible.utils.multicast }}" - name: "multicast: Test invalidness" @@ -12,7 +12,7 @@ criteria_check1: "{{ '127.0.0.1' is ansible.utils.multicast }}" - name: "multicast: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "multicast: Test invalidness" @@ -20,5 +20,5 @@ criteria_check2: "{{ 'helloworld' is ansible.utils.multicast }}" - name: "multicast: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/private.yml b/tests/integration/targets/utils_netaddr_test/tasks/private.yml index 2aaabd3..46af402 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/private.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/private.yml @@ -1,6 +1,6 @@ --- - name: "private: Check if 10.1.1.1 is a private IP address" - assert: + ansible.builtin.assert: that: "{{ '10.1.1.1' is ansible.utils.private }}" - name: "private: Test invalidness" @@ -8,5 +8,5 @@ criteria_check: "{{ '8.8.8.8' is ansible.utils.private }}" - name: "private: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/public.yml b/tests/integration/targets/utils_netaddr_test/tasks/public.yml index eb21870..8929d88 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/public.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/public.yml @@ -1,6 +1,6 @@ --- - name: "public: Check if 8.8.8.8 is a public IP address" - assert: + ansible.builtin.assert: that: "{{ '8.8.8.8' is ansible.utils.public }}" - name: "public: Test invalidness" @@ -8,5 +8,5 @@ criteria_check: "{{ '10.1.1.1' is ansible.utils.public }}" - name: "public: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/reserved.yml b/tests/integration/targets/utils_netaddr_test/tasks/reserved.yml index 20af728..e625602 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/reserved.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/reserved.yml @@ -1,6 +1,6 @@ --- - name: "reserved: Check if 253.0.0.1 is a reserved IP address" - assert: + ansible.builtin.assert: that: "{{ '253.0.0.1' is ansible.utils.reserved }}" - name: "reserved: Test invalidness" @@ -8,5 +8,5 @@ criteria_check: "{{ '128.146.1.7' is ansible.utils.reserved }}" - name: "reserved: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/resolvable.yml b/tests/integration/targets/utils_netaddr_test/tasks/resolvable.yml index 8d375c7..33c3174 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/resolvable.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/resolvable.yml @@ -1,14 +1,14 @@ --- - name: "resolvable: Check if {{ good_name }} is resolvable or not" - assert: + ansible.builtin.assert: that: "{{ good_name is ansible.utils.resolvable }}" - name: "resolvable: Check if {{ ipv4_localhost }} is resolvable or not" - assert: + ansible.builtin.assert: that: "{{ ipv4_localhost is ansible.utils.resolvable }}" - name: "resolvable: Check if {{ ipv6_localhost }} is resolvable or not" - assert: + ansible.builtin.assert: that: "{{ ipv6_localhost is ansible.utils.resolvable }}" - name: "resolvable: Test invalidness" @@ -16,7 +16,7 @@ criteria_check1: "{{ bad_name is ansible.utils.resolvable }}" - name: "resolvable: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "resolvable: Test invalidness" @@ -24,5 +24,5 @@ criteria_check2: "{{ 'invalidhost' is ansible.utils.resolvable }}" - name: "resolvable: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/subnet_of.yml b/tests/integration/targets/utils_netaddr_test/tasks/subnet_of.yml index a59b12a..ccfdbcd 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/subnet_of.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/subnet_of.yml @@ -1,6 +1,6 @@ --- - name: "subnet_of: Check if 10.1.1.0/24 is a subnet of 10.0.0.0/8" - assert: + ansible.builtin.assert: that: "{{ '10.1.1.0/24' is ansible.utils.subnet_of '10.0.0.0/8' }}" - name: "subnet_of: Test invalidness" @@ -8,7 +8,7 @@ criteria_check1: "{{ '10.0.0.0/8' is ansible.utils.subnet_of '10.1.1.0/24' }}" - name: "subnet_of: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "subnet_of: Test invalidness" @@ -16,5 +16,5 @@ criteria_check2: "{{ '192.168.1.0/24' is ansible.utils.subnet_of '10.0.0.0/8' }}" - name: "subnet_of: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/supernet_of.yml b/tests/integration/targets/utils_netaddr_test/tasks/supernet_of.yml index 8e5ce26..7941089 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/supernet_of.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/supernet_of.yml @@ -1,6 +1,6 @@ --- - name: "supernet_of: Check if 10.0.0.0/8 is a supernet of 10.1.1.0/24" - assert: + ansible.builtin.assert: that: "{{ '10.0.0.0/8' is ansible.utils.supernet_of '10.1.1.0/24' }}" - name: "supernet_of: Test invalidness" @@ -8,7 +8,7 @@ criteria_check1: "{{ '10.1.1.0/24' is ansible.utils.supernet_of '10.0.0.0/8' }}" - name: "supernet_of: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "supernet_of: Test invalidness" @@ -16,5 +16,5 @@ criteria_check2: "{{ '10.0.0.0/8' is ansible.utils.supernet_of '192.168.1.0/24' }}" - name: "supernet_of: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" diff --git a/tests/integration/targets/utils_netaddr_test/tasks/unspecified.yml b/tests/integration/targets/utils_netaddr_test/tasks/unspecified.yml index d371a5d..426aec5 100644 --- a/tests/integration/targets/utils_netaddr_test/tasks/unspecified.yml +++ b/tests/integration/targets/utils_netaddr_test/tasks/unspecified.yml @@ -1,14 +1,14 @@ --- - name: "unspecified: Check if 0.0.0.0 is an unspecified IP address" - assert: + ansible.builtin.assert: 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" - assert: + ansible.builtin.assert: that: "{{ '0:0:0:0:0:0:0:0' is ansible.utils.unspecified }}" - name: "unspecified: Check if :: is an unspecified IP address" - assert: + ansible.builtin.assert: that: "{{ '::' is ansible.utils.unspecified }}" - name: "unspecified: Test invalidness" @@ -16,7 +16,7 @@ criteria_check1: "{{ '127.0.0.1' is ansible.utils.unspecified }}" - name: "unspecified: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check1 == false }}" - name: "unspecified: Test invalidness" @@ -24,5 +24,5 @@ criteria_check2: "{{ '::1' is ansible.utils.unspecified }}" - name: "unspecified: Assert invalidness" - assert: + ansible.builtin.assert: that: "{{ criteria_check2 == false }}" diff --git a/tests/integration/targets/utils_param_list_compare/tasks/main.yaml b/tests/integration/targets/utils_param_list_compare/tasks/main.yaml index 3b21619..cfc8705 100644 --- a/tests/integration/targets/utils_param_list_compare/tasks/main.yaml +++ b/tests/integration/targets/utils_param_list_compare/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tasks" recurse: false @@ -10,5 +10,5 @@ delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_param_list_compare/tasks/simple.yaml b/tests/integration/targets/utils_param_list_compare/tasks/simple.yaml index 9a3d88b..563ec8a 100644 --- a/tests/integration/targets/utils_param_list_compare/tasks/simple.yaml +++ b/tests/integration/targets/utils_param_list_compare/tasks/simple.yaml @@ -1,5 +1,5 @@ --- -- debug: +- ansible.builtin.debug: msg: "START param_list_compare integration tests on connection={{ ansible_connection }}" - name: Setup supported resource module list json @@ -44,13 +44,13 @@ - "bgp_global" - name: Get the final list of resources - set_fact: + ansible.builtin.set_fact: final_network_resources: "{{ network_resources['modules']|ansible.utils.param_list_compare(provided_resources) }}" - name: Assert final network resources - assert: + ansible.builtin.assert: that: - "{{ expected_network_resources | symmetric_difference(final_network_resources['actionable']) |length\ \ == 0 }}" -- debug: +- ansible.builtin.debug: msg: "END param_list_compare integration tests on connection={{ ansible_connection }}" diff --git a/tests/integration/targets/utils_remove_keys/tasks/main.yaml b/tests/integration/targets/utils_remove_keys/tasks/main.yaml index 3b21619..cfc8705 100644 --- a/tests/integration/targets/utils_remove_keys/tasks/main.yaml +++ b/tests/integration/targets/utils_remove_keys/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tasks" recurse: false @@ -10,5 +10,5 @@ delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_remove_keys/tasks/simple.yaml b/tests/integration/targets/utils_remove_keys/tasks/simple.yaml index 1d5363a..889f8cf 100644 --- a/tests/integration/targets/utils_remove_keys/tasks/simple.yaml +++ b/tests/integration/targets/utils_remove_keys/tasks/simple.yaml @@ -29,11 +29,11 @@ mtu: 600 enabled: false -- debug: +- ansible.builtin.debug: msg: "{{ data|ansible.utils.remove_keys(target=['notes', 'comment']) }}" register: result - name: Assert result dicts - assert: + ansible.builtin.assert: that: - remove['default'] == result['msg'] diff --git a/tests/integration/targets/utils_replace_keys/tasks/main.yaml b/tests/integration/targets/utils_replace_keys/tasks/main.yaml index 3b21619..cfc8705 100644 --- a/tests/integration/targets/utils_replace_keys/tasks/main.yaml +++ b/tests/integration/targets/utils_replace_keys/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tasks" recurse: false @@ -10,5 +10,5 @@ delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_replace_keys/tasks/simple.yaml b/tests/integration/targets/utils_replace_keys/tasks/simple.yaml index d0b62df..1799ae2 100644 --- a/tests/integration/targets/utils_replace_keys/tasks/simple.yaml +++ b/tests/integration/targets/utils_replace_keys/tasks/simple.yaml @@ -25,11 +25,11 @@ mtu: 600 enabled: false -- debug: +- ansible.builtin.debug: msg: "{{ data|ansible.utils.replace_keys(target=[{'before':'interface_name', 'after':'name'}]) }}" register: result - name: Assert result dicts - assert: + ansible.builtin.assert: that: - replace['default'] == result['msg'] diff --git a/tests/integration/targets/utils_to_paths/tasks/argspec.yaml b/tests/integration/targets/utils_to_paths/tasks/argspec.yaml index 01b4084..4202131 100644 --- a/tests/integration/targets/utils_to_paths/tasks/argspec.yaml +++ b/tests/integration/targets/utils_to_paths/tasks/argspec.yaml @@ -12,9 +12,9 @@ ignore_errors: true register: result -- debug: +- ansible.builtin.debug: var: result -- assert: +- ansible.builtin.assert: that: "{{ msg in result.msg }}" vars: msg: "'5' is not a valid boolean" @@ -25,9 +25,9 @@ ignore_errors: true register: result -- debug: +- ansible.builtin.debug: var: result -- assert: +- ansible.builtin.assert: that: "{{ msg in result.msg }}" vars: msg: "missing required arguments: var" diff --git a/tests/integration/targets/utils_to_paths/tasks/empty_members.yaml b/tests/integration/targets/utils_to_paths/tasks/empty_members.yaml index 2a8d420..b1bb48e 100644 --- a/tests/integration/targets/utils_to_paths/tasks/empty_members.yaml +++ b/tests/integration/targets/utils_to_paths/tasks/empty_members.yaml @@ -11,7 +11,7 @@ empty_mapping: {} - name: Test filter and lookup plugin with empty list and mapping - assert: + ansible.builtin.assert: that: "{{ item.result == item.expected }}" loop: - result: "{{ a|ansible.utils.to_paths }}" diff --git a/tests/integration/targets/utils_to_paths/tasks/main.yaml b/tests/integration/targets/utils_to_paths/tasks/main.yaml index 3b21619..cfc8705 100644 --- a/tests/integration/targets/utils_to_paths/tasks/main.yaml +++ b/tests/integration/targets/utils_to_paths/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tasks" recurse: false @@ -10,5 +10,5 @@ delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_to_paths/tasks/simple.yaml b/tests/integration/targets/utils_to_paths/tasks/simple.yaml index 23970f2..2ae3d3d 100644 --- a/tests/integration/targets/utils_to_paths/tasks/simple.yaml +++ b/tests/integration/targets/utils_to_paths/tasks/simple.yaml @@ -8,7 +8,7 @@ - 1 - name: Test filter and lookup plugin, simple and prepend - assert: + ansible.builtin.assert: that: "{{ item.result == item.expected }}" loop: - result: "{{ a|ansible.utils.to_paths }}" @@ -36,7 +36,7 @@ - 0 - name: Test filter and lookup plugin, wantlist and prepend - assert: + ansible.builtin.assert: that: "{{ item.result == item.expected }}" loop: - result: "{{ a|ansible.utils.to_paths(wantlist=True) }}" diff --git a/tests/integration/targets/utils_to_xml/tasks/main.yaml b/tests/integration/targets/utils_to_xml/tasks/main.yaml index 3b21619..cfc8705 100644 --- a/tests/integration/targets/utils_to_xml/tasks/main.yaml +++ b/tests/integration/targets/utils_to_xml/tasks/main.yaml @@ -1,6 +1,6 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tasks" recurse: false @@ -10,5 +10,5 @@ delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_to_xml/tasks/simple.yaml b/tests/integration/targets/utils_to_xml/tasks/simple.yaml index aca6c8b..295012e 100644 --- a/tests/integration/targets/utils_to_xml/tasks/simple.yaml +++ b/tests/integration/targets/utils_to_xml/tasks/simple.yaml @@ -7,11 +7,11 @@ "interface-configuration": output: "\n\n\t\n" -- debug: +- ansible.builtin.debug: msg: "{{ data|ansible.utils.to_xml() }}" - name: Integration tests with and without default engine as xmltodict and - assert: + ansible.builtin.assert: that: "{{ output == item.test }}" loop: - test: "{{ data|ansible.utils.to_xml() }}" @@ -29,7 +29,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: "{{ msg in result.msg }}" vars: msg: "Error when using plugin 'to_xml': engine: dicttoxml is not supported" diff --git a/tests/integration/targets/utils_update_fact/tasks/main.yaml b/tests/integration/targets/utils_update_fact/tasks/main.yaml index 6d5165d..e3f721b 100644 --- a/tests/integration/targets/utils_update_fact/tasks/main.yaml +++ b/tests/integration/targets/utils_update_fact/tasks/main.yaml @@ -16,7 +16,7 @@ value: 20 register: updated -- assert: +- ansible.builtin.assert: that: "{{ updated.a == expected.a }}" vars: expected: @@ -38,7 +38,7 @@ - true register: updated -- assert: +- ansible.builtin.assert: that: "{{ updated.a == expected.a }}" vars: expected: @@ -58,7 +58,7 @@ index: "{{ a.b.c|ansible.utils.index_of('eq', 2) }}" register: updated -- assert: +- ansible.builtin.assert: that: "{{ updated.a == expected.a }}" vars: expected: diff --git a/tests/integration/targets/utils_usable_range/tasks/argspec.yml b/tests/integration/targets/utils_usable_range/tasks/argspec.yml index 0faba9a..5047aeb 100644 --- a/tests/integration/targets/utils_usable_range/tasks/argspec.yml +++ b/tests/integration/targets/utils_usable_range/tasks/argspec.yml @@ -5,7 +5,7 @@ ignore_errors: true register: result1 -- assert: +- ansible.builtin.assert: that: "{{ msg in result1.msg }}" vars: msg: "does not appear to be an IPv4 or IPv6 network" @@ -16,7 +16,7 @@ ignore_errors: true register: result2 -- assert: +- ansible.builtin.assert: that: "{{ msg in result2.msg }}" vars: msg: "does not appear to be an IPv4 or IPv6 network" @@ -27,7 +27,7 @@ ignore_errors: true register: result3 -- assert: +- ansible.builtin.assert: that: "{{ msg in result3.msg }}" vars: msg: "has host bits set" @@ -38,7 +38,7 @@ ignore_errors: true register: result4 -- assert: +- ansible.builtin.assert: that: "{{ msg in result4.msg }}" vars: msg: "does not appear to be an IPv4 or IPv6 network" @@ -49,7 +49,7 @@ ignore_errors: true register: result5 -- assert: +- ansible.builtin.assert: that: "{{ msg in result5.msg }}" vars: msg: "does not appear to be an IPv4 or IPv6 network" @@ -60,7 +60,7 @@ ignore_errors: true register: result6 -- assert: +- ansible.builtin.assert: that: "{{ msg in result6.msg }}" vars: msg: "does not appear to be an IPv4 or IPv6 network" @@ -71,7 +71,7 @@ ignore_errors: true register: result7 -- assert: +- ansible.builtin.assert: that: "{{ msg in result7.msg }}" vars: msg: "does not appear to be an IPv4 or IPv6 network" diff --git a/tests/integration/targets/utils_usable_range/tasks/example_filter.yml b/tests/integration/targets/utils_usable_range/tasks/example_filter.yml index d68176e..22c911c 100644 --- a/tests/integration/targets/utils_usable_range/tasks/example_filter.yml +++ b/tests/integration/targets/utils_usable_range/tasks/example_filter.yml @@ -5,7 +5,7 @@ result1: "{{ '10.1.1.1' | ansible.utils.usable_range }}" - name: Assert result for 10.1.1.1 - assert: + ansible.builtin.assert: that: "{{ result1 == result1_val }}" - name: Expand and produce list of usable IP addresses in 10.0.0.0/28 @@ -13,7 +13,7 @@ result2: "{{ '10.0.0.0/28' | ansible.utils.usable_range }}" - name: Assert result for 10.0.0.0/28 - assert: + ansible.builtin.assert: that: "{{ result2 == result2_val }}" - name: Expand and produce list of usable IP addresses in 192.0.2.0/24 @@ -21,7 +21,7 @@ result3: "{{ '192.0.2.0/24' | ansible.utils.usable_range }}" - name: Assert result for 192.0.2.0/24 - assert: + ansible.builtin.assert: # Since the list is huge, asserting only on number of ips that: "{{ result3.number_of_ips == result3_val.number_of_ips }}" @@ -31,7 +31,7 @@ result4: "{{ '2001:db8:abcd:0012::0/126' | ansible.utils.usable_range }}" - name: Assert result for 2001:db8:abcd:0012::0/126 - assert: + ansible.builtin.assert: that: "{{ result4 == result4_val }}" - name: "Expand and produce list of usable IP addresses in 2001:db8:abcd:12::" @@ -39,5 +39,5 @@ result5: "{{ '2001:db8:abcd:12::' | ansible.utils.usable_range }}" - name: "Assert result for 2001:db8:abcd:12::" - assert: + ansible.builtin.assert: that: "{{ result5 == result5_val }}" diff --git a/tests/integration/targets/utils_usable_range/tasks/main.yml b/tests/integration/targets/utils_usable_range/tasks/main.yml index 3b21619..cfc8705 100644 --- a/tests/integration/targets/utils_usable_range/tasks/main.yml +++ b/tests/integration/targets/utils_usable_range/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tasks" recurse: false @@ -10,5 +10,5 @@ delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_validate/tasks/main.yaml b/tests/integration/targets/utils_validate/tasks/main.yaml index 21e63bb..bb10177 100644 --- a/tests/integration/targets/utils_validate/tasks/main.yaml +++ b/tests/integration/targets/utils_validate/tasks/main.yaml @@ -1,11 +1,11 @@ --- - name: Recursively find all test files - find: + ansible.builtin.find: file_type: file paths: "{{ role_path }}/tests" recurse: true delegate_to: localhost register: found -- include: "{{ item.path }}" +- ansible.builtin.include_tasks: "{{ item.path }}" loop: "{{ found.files }}" diff --git a/tests/integration/targets/utils_validate/tests/config/filter.yaml b/tests/integration/targets/utils_validate/tests/config/filter.yaml index a41ba6b..bfe769b 100644 --- a/tests/integration/targets/utils_validate/tests/config/filter.yaml +++ b/tests/integration/targets/utils_validate/tests/config/filter.yaml @@ -20,7 +20,7 @@ ansible.builtin.set_fact: data_criteria_checks: "{{ fail_config|ansible.utils.validate(rules, engine='ansible.utils.config') }}" -- assert: +- ansible.builtin.assert: that: - "data_criteria_checks[0].found == 'interface Eth1/1'" - "data_criteria_checks[1].found == 'interface Loopback 10'" @@ -30,7 +30,7 @@ ansible.builtin.set_fact: data_criteria_checks: "{{ warn_config|ansible.utils.validate(rules, engine='ansible.utils.config') }}" -- assert: +- ansible.builtin.assert: that: - "data_criteria_checks == []" @@ -38,7 +38,7 @@ ansible.builtin.set_fact: data_criteria_checks: "{{ pass_config|ansible.utils.validate(rules, engine='ansible.utils.config') }}" -- assert: +- ansible.builtin.assert: that: - "data_criteria_checks == []" @@ -48,7 +48,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "result['failed'] == true" - '"is not one of \"warn\" or \"fail\"" in result["msg"]' diff --git a/tests/integration/targets/utils_validate/tests/config/lookup.yaml b/tests/integration/targets/utils_validate/tests/config/lookup.yaml index b5bbc50..d4f1f16 100644 --- a/tests/integration/targets/utils_validate/tests/config/lookup.yaml +++ b/tests/integration/targets/utils_validate/tests/config/lookup.yaml @@ -20,7 +20,7 @@ ansible.builtin.set_fact: data_criteria_checks: "{{ lookup('ansible.utils.validate', fail_config, rules, engine='ansible.utils.config') }}" -- assert: +- ansible.builtin.assert: that: - "data_criteria_checks[0].found == 'interface Eth1/1'" - "data_criteria_checks[1].found == 'interface Loopback 10'" @@ -30,7 +30,7 @@ ansible.builtin.set_fact: data_criteria_checks: "{{ lookup('ansible.utils.validate', warn_config, rules, engine='ansible.utils.config') }}" -- assert: +- ansible.builtin.assert: that: - "data_criteria_checks == []" @@ -38,7 +38,7 @@ ansible.builtin.set_fact: data_criteria_checks: "{{ lookup('ansible.utils.validate', pass_config, rules, engine='ansible.utils.config') }}" -- assert: +- ansible.builtin.assert: that: - "data_criteria_checks == []" @@ -48,7 +48,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "result['failed'] == true" - '"is not one of \"warn\" or \"fail\"" in result["msg"]' diff --git a/tests/integration/targets/utils_validate/tests/config/module.yaml b/tests/integration/targets/utils_validate/tests/config/module.yaml index ebcbc8c..ce54b8f 100644 --- a/tests/integration/targets/utils_validate/tests/config/module.yaml +++ b/tests/integration/targets/utils_validate/tests/config/module.yaml @@ -24,7 +24,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "'errors' in result" - "result['errors'][0].found == 'interface Eth1/1'" @@ -45,7 +45,7 @@ engine: ansible.utils.config register: result -- assert: +- ansible.builtin.assert: that: - "'errors' not in result" - "'warnings' in result" @@ -60,7 +60,7 @@ engine: ansible.utils.config register: result -- assert: +- ansible.builtin.assert: that: - "'errors' not in result" - "'warnings' not in result" @@ -75,7 +75,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "result['failed'] == true" - '"is not one of \"warn\" or \"fail\"" in result["msg"]' diff --git a/tests/integration/targets/utils_validate/tests/config/test.yaml b/tests/integration/targets/utils_validate/tests/config/test.yaml index a7de9ca..62018ee 100644 --- a/tests/integration/targets/utils_validate/tests/config/test.yaml +++ b/tests/integration/targets/utils_validate/tests/config/test.yaml @@ -20,7 +20,7 @@ ansible.builtin.set_fact: is_data_valid: "{{ fail_config is ansible.utils.validate(criteria=rules, engine='ansible.utils.config') }}" -- assert: +- ansible.builtin.assert: that: - "is_data_valid == false" @@ -28,7 +28,7 @@ ansible.builtin.set_fact: is_data_valid: "{{ warn_config is ansible.utils.validate(criteria=rules, engine='ansible.utils.config') }}" -- assert: +- ansible.builtin.assert: that: - "is_data_valid == true" @@ -36,7 +36,7 @@ ansible.builtin.set_fact: is_data_valid: "{{ pass_config is ansible.utils.validate(criteria=rules, engine='ansible.utils.config') }}" -- assert: +- ansible.builtin.assert: that: - "is_data_valid == true" @@ -46,7 +46,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "result['failed'] == true" - '"is not one of \"warn\" or \"fail\"" in result["msg"]' diff --git a/tests/integration/targets/utils_validate/tests/jsonschema/filter.yaml b/tests/integration/targets/utils_validate/tests/jsonschema/filter.yaml index c365e32..5526dcf 100644 --- a/tests/integration/targets/utils_validate/tests/jsonschema/filter.yaml +++ b/tests/integration/targets/utils_validate/tests/jsonschema/filter.yaml @@ -3,7 +3,7 @@ ansible.builtin.set_fact: data_criteria_checks: "{{ show_interfaces|ansible.utils.validate([oper_status, enable_check, crc_error_check], engine='ansible.utils.jsonschema') }}" -- assert: +- ansible.builtin.assert: that: - "data_criteria_checks[0].data_path == 'GigabitEthernet0/0/0/0.oper_status'" - "data_criteria_checks[1].data_path == 'GigabitEthernet0/0/0/1.enabled'" @@ -13,7 +13,7 @@ ansible.builtin.set_fact: data_criteria_checks: "{{ show_interfaces|ansible.utils.validate(in_rate_check) }}" -- assert: +- ansible.builtin.assert: that: - "data_criteria_checks == []" @@ -23,7 +23,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "'value of draft must be one of: draft3, draft4, draft6, draft7, got: draft0' in result.msg" @@ -33,7 +33,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "'errors' not in result" - "result['failed'] == true" @@ -45,7 +45,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "result['failed'] == true" - "'\\'data\\' option value is invalid' in result.msg" @@ -56,7 +56,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "result['failed'] == true" - "'\\'criteria\\' option value is invalid' in result.msg" @@ -73,7 +73,7 @@ ansible.builtin.set_fact: data_criteria_checks: "{{ data|ansible.utils.validate([oper_status_up_criteria, enabled_check_criteria, crc_error_check_criteria]) }}" -- assert: +- ansible.builtin.assert: that: - "data_criteria_checks[0].data_path == 'GigabitEthernet0/0/0/0.oper_status'" - "data_criteria_checks[1].data_path == 'GigabitEthernet0/0/0/1.enabled'" @@ -83,6 +83,6 @@ ansible.builtin.set_fact: data_criteria_checks: "{{ data|ansible.utils.validate(in_rate_check_criteria) }}" -- assert: +- ansible.builtin.assert: that: - "data_criteria_checks == []" diff --git a/tests/integration/targets/utils_validate/tests/jsonschema/lookup.yaml b/tests/integration/targets/utils_validate/tests/jsonschema/lookup.yaml index 04ab711..4304a25 100644 --- a/tests/integration/targets/utils_validate/tests/jsonschema/lookup.yaml +++ b/tests/integration/targets/utils_validate/tests/jsonschema/lookup.yaml @@ -5,7 +5,7 @@ vars: ansible_validate_jsonschema_draft: draft7 -- assert: +- ansible.builtin.assert: that: - "data_criteria_checks[0].data_path == 'GigabitEthernet0/0/0/0.oper_status'" - "data_criteria_checks[1].data_path == 'GigabitEthernet0/0/0/1.enabled'" @@ -17,7 +17,7 @@ vars: ansible_validate_jsonschema_draft: draft7 -- assert: +- ansible.builtin.assert: that: - "data_criteria_checks == []" @@ -29,7 +29,7 @@ vars: ansible_validate_jsonschema_draft: draft7 -- assert: +- ansible.builtin.assert: that: - "'value of draft must be one of: draft3, draft4, draft6, draft7, got: draft0' in result.msg" @@ -41,7 +41,7 @@ vars: ansible_validate_jsonschema_draft: draft0 -- assert: +- ansible.builtin.assert: that: - "'value of draft must be one of: draft3, draft4, draft6, draft7, got: draft0' in result.msg" @@ -51,7 +51,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "'errors' not in result" - "result['failed'] == true" @@ -63,7 +63,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "result['failed'] == true" - "'\\'data\\' option value is invalid' in result.msg" @@ -74,7 +74,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "result['failed'] == true" - "'\\'criteria\\' option value is invalid' in result.msg" @@ -91,7 +91,7 @@ ansible.builtin.set_fact: data_criteria_checks: "{{ lookup('ansible.utils.validate', data, [oper_status_up_criteria, enabled_check_criteria, crc_error_check_criteria], engine='ansible.utils.jsonschema') }}" -- assert: +- ansible.builtin.assert: that: - "data_criteria_checks[0].data_path == 'GigabitEthernet0/0/0/0.oper_status'" - "data_criteria_checks[1].data_path == 'GigabitEthernet0/0/0/1.enabled'" @@ -101,6 +101,6 @@ ansible.builtin.set_fact: data_criteria_checks: "{{ lookup('ansible.utils.validate', data, in_rate_check_criteria, engine='ansible.utils.jsonschema') }}" -- assert: +- ansible.builtin.assert: that: - "data_criteria_checks == []" diff --git a/tests/integration/targets/utils_validate/tests/jsonschema/module.yaml b/tests/integration/targets/utils_validate/tests/jsonschema/module.yaml index 5de1305..17391af 100644 --- a/tests/integration/targets/utils_validate/tests/jsonschema/module.yaml +++ b/tests/integration/targets/utils_validate/tests/jsonschema/module.yaml @@ -12,7 +12,7 @@ vars: ansible_validate_jsonschema_draft: draft7 -- assert: +- ansible.builtin.assert: that: - "'errors' in result" - "result['errors'][0].data_path == 'GigabitEthernet0/0/0/0.oper_status'" @@ -33,7 +33,7 @@ vars: ansible_validate_jsonschema_draft: draft7 -- assert: +- ansible.builtin.assert: that: - "'errors' not in result" - "'All checks passed' in result.msg" @@ -48,7 +48,7 @@ vars: ansible_validate_jsonschema_draft: draft0 -- assert: +- ansible.builtin.assert: that: - "'errors' not in result" - "result['failed'] == true" @@ -62,7 +62,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "'errors' not in result" - "result['failed'] == true" @@ -76,7 +76,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "result['failed'] == true" - "'\\'data\\' option value is invalid' in result.msg" @@ -89,7 +89,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "result['failed'] == true" - "'\\'criteria\\' option value is invalid' in result.msg" @@ -107,7 +107,7 @@ vars: ansible_validate_jsonschema_draft: draft7 -- assert: +- ansible.builtin.assert: that: - "'errors' in result" - "result['errors'][0].data_path == 'GigabitEthernet0/0/0/0.oper_status'" @@ -128,7 +128,7 @@ vars: ansible_validate_jsonschema_draft: draft7 -- assert: +- ansible.builtin.assert: that: - "'errors' not in result" - "'All checks passed' in result.msg" @@ -139,7 +139,7 @@ criteria: "{{ lookup('ansible.builtin.file', 'criteria/check_list_data.json') }}" engine: ansible.utils.jsonschema -- assert: +- ansible.builtin.assert: that: - "'errors' not in result" - "'All checks passed' in result.msg" diff --git a/tests/integration/targets/utils_validate/tests/jsonschema/test.yaml b/tests/integration/targets/utils_validate/tests/jsonschema/test.yaml index dd68d26..2808398 100644 --- a/tests/integration/targets/utils_validate/tests/jsonschema/test.yaml +++ b/tests/integration/targets/utils_validate/tests/jsonschema/test.yaml @@ -3,7 +3,7 @@ ansible.builtin.set_fact: is_data_valid: "{{ show_interfaces is ansible.utils.validate(engine='ansible.utils.jsonschema', criteria=[oper_status, enable_check, crc_error_check], draft='draft7') }}" -- assert: +- ansible.builtin.assert: that: - "is_data_valid == false" @@ -11,7 +11,7 @@ ansible.builtin.set_fact: is_data_valid: "{{ show_interfaces is ansible.utils.validate(criteria=in_rate_check) }}" -- assert: +- ansible.builtin.assert: that: - "is_data_valid == true" @@ -21,7 +21,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "'value of draft must be one of: draft3, draft4, draft6, draft7, got: draft0' in result.msg" @@ -31,7 +31,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "'errors' not in result" - "result['failed'] == true" @@ -43,7 +43,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "result['failed'] == true" - "'\\'data\\' option value is invalid' in result.msg" @@ -54,7 +54,7 @@ ignore_errors: true register: result -- assert: +- ansible.builtin.assert: that: - "result['failed'] == true" - "'\\'criteria\\' option value is invalid' in result.msg" @@ -71,7 +71,7 @@ ansible.builtin.set_fact: is_data_valid: "{{ show_interfaces is ansible.utils.validate(engine='ansible.utils.jsonschema', criteria=[oper_status_up_criteria, enabled_check_criteria, crc_error_check_criteria], draft='draft7') }}" -- assert: +- ansible.builtin.assert: that: - "is_data_valid == false" @@ -83,7 +83,7 @@ ansible.builtin.set_fact: data_criteria_checks: "{{ data|ansible.utils.validate(in_rate_check_criteria) }}" -- assert: +- ansible.builtin.assert: that: - "is_data_valid == true" @@ -96,6 +96,6 @@ ansible.builtin.set_fact: is_data_valid: "{{ data is ansible.utils.validate(engine='ansible.utils.jsonschema', criteria=[criteria_1], draft='draft7') }}" -- assert: +- ansible.builtin.assert: that: - "is_data_valid == true"