From 101920be5c1bbcfea57d0a41619e876ac982de21 Mon Sep 17 00:00:00 2001 From: Wen Liang Date: Mon, 13 Feb 2023 07:48:26 -0500 Subject: [PATCH] ansible-lint: Fix yaml[truthy] failures Signed-off-by: Wen Liang --- tests/get_coverage.yml | 6 +++--- tests/playbooks/tests_802_1x.yml | 2 +- tests/playbooks/tests_auto_gateway.yml | 12 +++++------ tests/playbooks/tests_bond_cloned_mac.yml | 6 +++--- tests/playbooks/tests_bond_options.yml | 4 ++-- tests/playbooks/tests_bond_removal.yml | 12 +++++------ tests/playbooks/tests_bridge.yml | 4 ++-- tests/playbooks/tests_bridge_cloned_mac.yml | 6 +++--- tests/playbooks/tests_eth_dns_support.yml | 14 ++++++------- .../playbooks/tests_eth_pci_address_match.yml | 6 +++--- tests/playbooks/tests_ethernet.yml | 2 +- tests/playbooks/tests_ethtool_coalesce.yml | 12 +++++------ tests/playbooks/tests_ethtool_ring.yml | 12 +++++------ tests/playbooks/tests_infiniband.yml | 8 ++++---- tests/playbooks/tests_ipv6_disabled.yml | 2 +- tests/playbooks/tests_ipv6_dns_search.yml | 8 ++++---- tests/playbooks/tests_network_state.yml | 12 +++++------ tests/playbooks/tests_route_table.yml | 16 +++++++-------- tests/playbooks/tests_routing_rules.yml | 20 +++++++++---------- tests/playbooks/tests_wireless_wpa3_owe.yml | 2 +- tests/playbooks/tests_wireless_wpa3_sae.yml | 2 +- tests/tasks/get_profile_stat.yml | 2 +- tests/tasks/manage_test_interface.yml | 2 +- .../create_and_remove_with_initscripts.yml | 2 +- tests/tasks/provider/create_with_nm.yml | 2 +- 25 files changed, 88 insertions(+), 88 deletions(-) diff --git a/tests/get_coverage.yml b/tests/get_coverage.yml index 8a26d67..8a90cee 100644 --- a/tests/get_coverage.yml +++ b/tests/get_coverage.yml @@ -30,7 +30,7 @@ command: "{{ coverage }} combine" environment: COVERAGE_FILE: "{{ coverage_file }}" - ignore_errors: yes + ignore_errors: true changed_when: false - name: remove old data @@ -42,7 +42,7 @@ find: path: "{{ ansible_env.HOME }}" patterns: ".coverage.*" - hidden: yes + hidden: true register: files_to_delete - name: remove old data @@ -84,4 +84,4 @@ fetch: src: "{{ coverage_file }}" dest: "{{ destdir }}" - flat: no + flat: false diff --git a/tests/playbooks/tests_802_1x.yml b/tests/playbooks/tests_802_1x.yml index 4d6da39..aecc688 100644 --- a/tests/playbooks/tests_802_1x.yml +++ b/tests/playbooks/tests_802_1x.yml @@ -78,7 +78,7 @@ client_cert: /etc/pki/tls/client.pem private_key_password_flags: - not-required - system_ca_certs: True + system_ca_certs: true domain_suffix_match: example.com - name: "TEST: I can ping the EAP server" command: ping -c1 203.0.113.1 diff --git a/tests/playbooks/tests_auto_gateway.yml b/tests/playbooks/tests_auto_gateway.yml index 05addbf..e1bd0bf 100644 --- a/tests/playbooks/tests_auto_gateway.yml +++ b/tests/playbooks/tests_auto_gateway.yml @@ -23,9 +23,9 @@ type: ethernet state: up ip: - auto_gateway: yes - dhcp4: no - auto6: no + auto_gateway: true + dhcp4: false + auto6: false address: - "2001:db8::2/64" - "203.0.113.2/24" @@ -91,9 +91,9 @@ type: ethernet state: up ip: - auto_gateway: no - dhcp4: no - auto6: no + auto_gateway: false + dhcp4: false + auto6: false address: - "2001:db8::2/64" - "203.0.113.2/24" diff --git a/tests/playbooks/tests_bond_cloned_mac.yml b/tests/playbooks/tests_bond_cloned_mac.yml index 7582ba8..123cced 100644 --- a/tests/playbooks/tests_bond_cloned_mac.yml +++ b/tests/playbooks/tests_bond_cloned_mac.yml @@ -57,7 +57,7 @@ command: >- nmcli -f 802-3-ethernet.cloned-mac-address con show {{ item.name }} register: cloned_mac_address - ignore_errors: yes + ignore_errors: true changed_when: false loop: - { name: "{{ controller_profile }}", mac: "12:23:34:45:56:60"} @@ -79,7 +79,7 @@ grep 'MACADDR' /etc/sysconfig/network-scripts/ifcfg-{{ controller_profile }} register: mac_address_controller - ignore_errors: yes + ignore_errors: true changed_when: false when: network_provider == 'initscripts' @@ -88,7 +88,7 @@ grep 'MACADDR' /etc/sysconfig/network-scripts/ifcfg-{{ port1_profile }} register: mac_address_port1 - ignore_errors: yes + ignore_errors: true changed_when: false when: network_provider == 'initscripts' diff --git a/tests/playbooks/tests_bond_options.yml b/tests/playbooks/tests_bond_options.yml index a0292ff..0e3695a 100644 --- a/tests/playbooks/tests_bond_options.yml +++ b/tests/playbooks/tests_bond_options.yml @@ -41,7 +41,7 @@ ad_actor_system: 00:00:5e:00:53:5d ad_select: stable ad_user_port_key: 1023 - all_ports_active: True + all_ports_active: true downdelay: 0 lacp_rate: slow lp_interval: 128 @@ -51,7 +51,7 @@ primary_reselect: better resend_igmp: 225 updelay: 0 - use_carrier: True + use_carrier: true xmit_hash_policy: encap2+3 ip: route_metric4: 65535 diff --git a/tests/playbooks/tests_bond_removal.yml b/tests/playbooks/tests_bond_removal.yml index d70cf40..4fa4891 100644 --- a/tests/playbooks/tests_bond_removal.yml +++ b/tests/playbooks/tests_bond_removal.yml @@ -98,7 +98,7 @@ connection command: nmcli c show --active {{ port1_profile }} register: active_port1_profile - ignore_errors: yes + ignore_errors: true changed_when: false when: network_provider == "nm" @@ -106,7 +106,7 @@ connection command: nmcli c show --active {{ port2_profile }} register: active_port2_profile - ignore_errors: yes + ignore_errors: true changed_when: false when: network_provider == "nm" @@ -127,14 +127,14 @@ - name: Get the port1 device state command: ip a s test1 register: port1_state - ignore_errors: yes + ignore_errors: true changed_when: false when: network_provider == "initscripts" - name: Get the port2 device state command: ip a s test2 register: port2_state - ignore_errors: yes + ignore_errors: true changed_when: false when: network_provider == "initscripts" @@ -196,7 +196,7 @@ active connection command: nmcli c show --active {{ controller_profile }} register: active_controller_profile - ignore_errors: yes + ignore_errors: true changed_when: false when: network_provider == "nm" @@ -211,7 +211,7 @@ - name: Get the controller device details command: ip -d a s nm-bond register: controller_state - ignore_errors: yes + ignore_errors: true changed_when: false when: network_provider == "initscripts" diff --git a/tests/playbooks/tests_bridge.yml b/tests/playbooks/tests_bridge.yml index 0d76264..a977d73 100644 --- a/tests/playbooks/tests_bridge.yml +++ b/tests/playbooks/tests_bridge.yml @@ -21,8 +21,8 @@ state: up type: bridge ip: - dhcp4: no - auto6: yes + dhcp4: false + auto6: true roles: - linux-system-roles.network diff --git a/tests/playbooks/tests_bridge_cloned_mac.yml b/tests/playbooks/tests_bridge_cloned_mac.yml index 806d2e5..edef00e 100644 --- a/tests/playbooks/tests_bridge_cloned_mac.yml +++ b/tests/playbooks/tests_bridge_cloned_mac.yml @@ -17,8 +17,8 @@ state: up type: bridge ip: - dhcp4: no - auto6: yes + dhcp4: false + auto6: true cloned_mac: "{{ cloned_mac }}" roles: - linux-system-roles.network @@ -35,7 +35,7 @@ command: >- nmcli -f 802-3-ethernet.cloned-mac-address con show {{ interface }} register: cloned_mac_address_nm - ignore_errors: yes + ignore_errors: true changed_when: false when: - network_provider == "nm" diff --git a/tests/playbooks/tests_eth_dns_support.yml b/tests/playbooks/tests_eth_dns_support.yml index 8cd3978..4e98270 100644 --- a/tests/playbooks/tests_eth_dns_support.yml +++ b/tests/playbooks/tests_eth_dns_support.yml @@ -29,10 +29,10 @@ interface_name: "{{ interface }}" state: up type: ethernet - autoconnect: yes + autoconnect: true ip: route_metric4: 100 - dhcp4: no + dhcp4: false gateway4: 192.0.2.1 dns_priority: 9999 dns: @@ -47,7 +47,7 @@ - timeout:1 route_metric6: -1 - auto6: no + auto6: false gateway6: 2001:db8::1 address: @@ -64,15 +64,15 @@ prefix: 26 gateway: 198.51.100.6 metric: 4 - route_append_only: no - rule_append_only: yes + route_append_only: false + rule_append_only: true - name: Verify nmcli connection DNS entry for IPv4 shell: | set -euxo pipefail nmcli connection show {{ interface }} | grep ipv4.dns register: ipv4_dns - ignore_errors: yes + ignore_errors: true changed_when: false - name: Verify nmcli connection DNS entry for IPv6 @@ -80,7 +80,7 @@ set -euxo pipefail nmcli connection show {{ interface }} | grep ipv6.dns register: ipv6_dns - ignore_errors: yes + ignore_errors: true changed_when: false - name: "Assert that DNS addresses are configured correctly" diff --git a/tests/playbooks/tests_eth_pci_address_match.yml b/tests/playbooks/tests_eth_pci_address_match.yml index 5a5316e..b81caa8 100644 --- a/tests/playbooks/tests_eth_pci_address_match.yml +++ b/tests/playbooks/tests_eth_pci_address_match.yml @@ -16,14 +16,14 @@ path: - pci-0001:00:00.0 ip: - dhcp4: no + dhcp4: false address: - 192.0.2.3/24 - block: - name: Get match.path setting for connection command: nmcli -f match.path connection show pseudo-pci-test-only register: match_path - ignore_errors: yes + ignore_errors: true changed_when: false - name: Assert that the connection profile contains the specified PCI @@ -55,7 +55,7 @@ - name: Get match.path setting for connection command: nmcli -f match.path connection show pseudo-pci-test-only register: clear_path - ignore_errors: yes + ignore_errors: true changed_when: false - name: "Assert that the PCI address is removed" diff --git a/tests/playbooks/tests_ethernet.yml b/tests/playbooks/tests_ethernet.yml index 84c7ef5..3b70a6e 100644 --- a/tests/playbooks/tests_ethernet.yml +++ b/tests/playbooks/tests_ethernet.yml @@ -34,7 +34,7 @@ interface_name: "{{ interface }}" state: up type: ethernet - autoconnect: yes + autoconnect: true ip: address: 192.0.2.1/24 roles: diff --git a/tests/playbooks/tests_ethtool_coalesce.yml b/tests/playbooks/tests_ethtool_coalesce.yml index fc46031..0fe3b60 100644 --- a/tests/playbooks/tests_ethtool_coalesce.yml +++ b/tests/playbooks/tests_ethtool_coalesce.yml @@ -38,8 +38,8 @@ type: ethernet state: up ip: - dhcp4: no - auto6: no + dhcp4: false + auto6: false - name: Get profile's coalescing options command: nmcli -g ethtool.coalesce-rx-frames c show {{ interface }} @@ -77,8 +77,8 @@ type: ethernet state: up ip: - dhcp4: no - auto6: no + dhcp4: false + auto6: false ethtool: coalesce: rx_frames: 128 @@ -118,8 +118,8 @@ type: ethernet state: up ip: - dhcp4: no - auto6: no + dhcp4: false + auto6: false - name: Get profile's coalescing options command: nmcli -g ethtool.coalesce-rx-frames c show {{ interface }} diff --git a/tests/playbooks/tests_ethtool_ring.yml b/tests/playbooks/tests_ethtool_ring.yml index 0c41474..665243f 100644 --- a/tests/playbooks/tests_ethtool_ring.yml +++ b/tests/playbooks/tests_ethtool_ring.yml @@ -38,8 +38,8 @@ type: ethernet state: up ip: - dhcp4: no - auto6: no + dhcp4: false + auto6: false - name: Get profile's ring options command: nmcli -g ethtool.ring-rx c show {{ interface }} @@ -77,8 +77,8 @@ type: ethernet state: up ip: - dhcp4: no - auto6: no + dhcp4: false + auto6: false ethtool: ring: rx: 128 @@ -156,8 +156,8 @@ type: ethernet state: up ip: - dhcp4: no - auto6: no + dhcp4: false + auto6: false - name: Get profile's ring options command: nmcli -g ethtool.ring-rx c show {{ interface }} diff --git a/tests/playbooks/tests_infiniband.yml b/tests/playbooks/tests_infiniband.yml index 96646ba..a81fd70 100644 --- a/tests/playbooks/tests_infiniband.yml +++ b/tests/playbooks/tests_infiniband.yml @@ -17,15 +17,15 @@ - name: ib0-10 type: infiniband - autoconnect: yes + autoconnect: true infiniband: p_key: 10 transport_mode: datagram parent: ib0 state: up ip: - dhcp4: no - auto6: no + dhcp4: false + auto6: false address: - 198.51.100.133/30 - 2001:db8::2/32 @@ -33,7 +33,7 @@ - name: Get the details for the virtual device ib0.000a command: ip -d a s ib0.000a register: virtual_device_setting - ignore_errors: yes + ignore_errors: true changed_when: false - name: Assert that the settings in the virtual device diff --git a/tests/playbooks/tests_ipv6_disabled.yml b/tests/playbooks/tests_ipv6_disabled.yml index 62f978d..ac7842b 100644 --- a/tests/playbooks/tests_ipv6_disabled.yml +++ b/tests/playbooks/tests_ipv6_disabled.yml @@ -54,7 +54,7 @@ set -euxo pipefail nmcli connection show {{ interface }} | grep ipv6.method register: ipv6_method - ignore_errors: yes + ignore_errors: true changed_when: false when: not __network_connections_result.failed diff --git a/tests/playbooks/tests_ipv6_dns_search.yml b/tests/playbooks/tests_ipv6_dns_search.yml index ac11641..faa6c13 100644 --- a/tests/playbooks/tests_ipv6_dns_search.yml +++ b/tests/playbooks/tests_ipv6_dns_search.yml @@ -21,13 +21,13 @@ - name: Get DNS search entry for IPv4 command: nmcli -f ipv4.dns-search connection show br-example register: ipv4_dns_search - ignore_errors: yes + ignore_errors: true changed_when: false - name: Get DNS search entry for IPv6 command: nmcli -f ipv6.dns-search connection show br-example register: ipv6_dns_search - ignore_errors: yes + ignore_errors: true changed_when: false - name: Assert that IPv4 DNS search entry is configured correctly @@ -67,7 +67,7 @@ - name: Get DNS search entry for IPv6 command: nmcli -f ipv6.dns-search connection show br-example register: ipv6_dns_search_static - ignore_errors: yes + ignore_errors: true changed_when: false - name: Assert that DNS search setting for IPv6 is configured when @@ -99,7 +99,7 @@ - name: Get DNS search entry for IPv6 command: nmcli -f ipv6.dns-search connection show br-example register: ipv6_dns_search_static_only - ignore_errors: yes + ignore_errors: true changed_when: false - name: Assert that DNS search setting for IPv6 is configured when only diff --git a/tests/playbooks/tests_network_state.yml b/tests/playbooks/tests_network_state.yml index ac775d4..3d43f19 100644 --- a/tests/playbooks/tests_network_state.yml +++ b/tests/playbooks/tests_network_state.yml @@ -71,13 +71,13 @@ - name: Get the ethtest0 state configuration command: nmstatectl show ethtest0 register: ethtest0_state - ignore_errors: yes # noqa ignore-errors + ignore_errors: true # noqa ignore-errors changed_when: false - name: Get the ethtest1 state configuration command: nmstatectl show ethtest1 register: ethtest1_state - ignore_errors: yes # noqa ignore-errors + ignore_errors: true # noqa ignore-errors changed_when: false - name: Assert that the ethtest0 state configuration contains the specified @@ -113,7 +113,7 @@ - name: Get the route configuration command: nmstatectl show register: route - ignore_errors: yes # noqa ignore-errors + ignore_errors: true # noqa ignore-errors changed_when: false - name: Assert that the route configuration contains the specified route @@ -165,19 +165,19 @@ - name: Get the DNS configuration from nmstatectl command: nmstatectl show register: nmstatectl - ignore_errors: yes # noqa ignore-errors + ignore_errors: true # noqa ignore-errors changed_when: false - name: Get the DNS configuration from the file `/etc/resolv.conf` command: cat /etc/resolv.conf register: resolvconf - ignore_errors: yes # noqa ignore-errors + ignore_errors: true # noqa ignore-errors changed_when: false - name: Check if `/etc/resolv.conf` is generated by NM command: grep "Generated by NetworkManager" /etc/resolv.conf register: generateByNM - ignore_errors: yes # noqa ignore-errors + ignore_errors: true # noqa ignore-errors changed_when: false - name: Assert that the nmstatectl contains the specified DNS configuration diff --git a/tests/playbooks/tests_route_table.yml b/tests/playbooks/tests_route_table.yml index 3d501c8..59f38af 100644 --- a/tests/playbooks/tests_route_table.yml +++ b/tests/playbooks/tests_route_table.yml @@ -30,9 +30,9 @@ interface_name: "{{ interface }}" state: up type: ethernet - autoconnect: yes + autoconnect: true ip: - dhcp4: no + dhcp4: false address: - 198.51.100.3/26 route: @@ -50,13 +50,13 @@ - name: Get the routes from the route table 30200 command: ip route show table 30200 register: route_table_30200 - ignore_errors: yes + ignore_errors: true changed_when: false - name: Get the routes from the route table 30400 command: ip route show table 30400 register: route_table_30400 - ignore_errors: yes + ignore_errors: true changed_when: false - name: Assert that the route table 30200 contains the specified route @@ -82,7 +82,7 @@ path: /etc/iproute2/rt_tables.d/table.conf line: "200 custom" mode: "0644" - create: yes + create: true - name: Reconfigure connection profile and specify the named table in static routes @@ -94,9 +94,9 @@ interface_name: "{{ interface }}" state: up type: ethernet - autoconnect: yes + autoconnect: true ip: - dhcp4: no + dhcp4: false address: - 198.51.100.3/26 route: @@ -114,7 +114,7 @@ - name: Get the routes from the named route table 'custom' command: ip route show table custom register: route_table_custom - ignore_errors: yes + ignore_errors: true changed_when: false - name: Assert that the named route table 'custom' contains the diff --git a/tests/playbooks/tests_routing_rules.yml b/tests/playbooks/tests_routing_rules.yml index 0038cc7..2235b06 100644 --- a/tests/playbooks/tests_routing_rules.yml +++ b/tests/playbooks/tests_routing_rules.yml @@ -25,7 +25,7 @@ path: /etc/iproute2/rt_tables.d/table.conf line: "200 custom" mode: "0644" - create: yes + create: true - name: Configure connection profile and specify the numeric table in static routes @@ -37,9 +37,9 @@ interface_name: "{{ interface }}" state: up type: ethernet - autoconnect: yes + autoconnect: true ip: - dhcp4: no + dhcp4: false address: - 198.51.100.3/26 - 2001:db8::2/32 @@ -97,7 +97,7 @@ - priority: 30601 family: ipv6 dport: 128 - 256 - invert: True + invert: true table: 30600 - priority: 200 from: 198.51.100.56/26 @@ -108,41 +108,41 @@ - name: Get the routing rule for looking up the table 30200 command: ip rule list table 30200 register: route_rule_table_30200 - ignore_errors: yes + ignore_errors: true changed_when: false when: ansible_distribution_major_version != "7" - name: Get the routing rule for looking up the table 30400 command: ip rule list table 30400 register: route_rule_table_30400 - ignore_errors: yes + ignore_errors: true changed_when: false when: ansible_distribution_major_version != "7" - name: Get the routing rule for looking up the table 30600 command: ip -6 rule list table 30600 register: route_rule_table_30600 - ignore_errors: yes + ignore_errors: true changed_when: false when: ansible_distribution_major_version != "7" - name: Get the routing rule for looking up the table 'custom' command: ip rule list table custom register: route_rule_table_custom - ignore_errors: yes + ignore_errors: true changed_when: false when: ansible_distribution_major_version != "7" - name: Get the IPv4 routing rule for the connection "{{ interface }}" command: nmcli -f ipv4.routing-rules c show "{{ interface }}" register: connection_route_rule - ignore_errors: yes + ignore_errors: true changed_when: false - name: Get the IPv6 routing rule for the connection "{{ interface }}" command: nmcli -f ipv6.routing-rules c show "{{ interface }}" register: connection_route_rule6 - ignore_errors: yes + ignore_errors: true changed_when: false - name: Assert that the routing rule with table lookup 30200 matches the diff --git a/tests/playbooks/tests_wireless_wpa3_owe.yml b/tests/playbooks/tests_wireless_wpa3_owe.yml index a4a5ded..399195e 100644 --- a/tests/playbooks/tests_wireless_wpa3_owe.yml +++ b/tests/playbooks/tests_wireless_wpa3_owe.yml @@ -34,7 +34,7 @@ shell: nmcli c show {{ interface }} | grep 802-11-wireless-security.key-mgmt register: key_mgmt - ignore_errors: yes + ignore_errors: true changed_when: false - name: "Assert that OWE is configured correctly" diff --git a/tests/playbooks/tests_wireless_wpa3_sae.yml b/tests/playbooks/tests_wireless_wpa3_sae.yml index c18a468..24435e9 100644 --- a/tests/playbooks/tests_wireless_wpa3_sae.yml +++ b/tests/playbooks/tests_wireless_wpa3_sae.yml @@ -34,7 +34,7 @@ set -euxo pipefail nmcli c show {{ interface }} | grep 802-11-wireless-security.key-mgmt register: key_mgmt - ignore_errors: yes + ignore_errors: true changed_when: false - name: "Assert that WPA3 Personal is configured correctly" diff --git a/tests/tasks/get_profile_stat.yml b/tests/tasks/get_profile_stat.yml index e17ae53..4b00d02 100644 --- a/tests/tasks/get_profile_stat.yml +++ b/tests/tasks/get_profile_stat.yml @@ -24,7 +24,7 @@ - name: Get NM profile info shell: nmcli -f NAME,FILENAME connection show |grep {{ profile }} | grep /etc register: nm_profile_exists - ignore_errors: yes + ignore_errors: true changed_when: false # lsr_net_profile_ansible_managed: diff --git a/tests/tasks/manage_test_interface.yml b/tests/tasks/manage_test_interface.yml index fec82f9..d27b2a6 100644 --- a/tests/tasks/manage_test_interface.yml +++ b/tests/tasks/manage_test_interface.yml @@ -30,7 +30,7 @@ command: nmcli d set {{ interface }} managed true # The varible for `network_provider` is not exists yet, # just ignore error for initscripts - ignore_errors: yes # noqa ignore-errors + ignore_errors: true # noqa ignore-errors when: "type == 'veth' and state == 'present'" - name: Delete veth interface {{ interface }} diff --git a/tests/tasks/provider/create_and_remove_with_initscripts.yml b/tests/tasks/provider/create_and_remove_with_initscripts.yml index f88d2c3..1bf3330 100644 --- a/tests/tasks/provider/create_and_remove_with_initscripts.yml +++ b/tests/tasks/provider/create_and_remove_with_initscripts.yml @@ -9,7 +9,7 @@ state: up persistent_state: present type: ethernet - autoconnect: yes + autoconnect: true ip: address: 192.0.2.1/24 network_provider: initscripts diff --git a/tests/tasks/provider/create_with_nm.yml b/tests/tasks/provider/create_with_nm.yml index f438c4f..aa98d05 100644 --- a/tests/tasks/provider/create_with_nm.yml +++ b/tests/tasks/provider/create_with_nm.yml @@ -9,7 +9,7 @@ state: up persistent_state: present type: ethernet - autoconnect: yes + autoconnect: true ip: address: 192.0.2.1/24 network_provider: nm