ansible-lint: Fix yaml[truthy] failures

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
This commit is contained in:
Wen Liang 2023-02-13 07:48:26 -05:00 committed by Till Maas
parent 7c0579ddfc
commit 101920be5c
25 changed files with 88 additions and 88 deletions

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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'

View file

@ -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

View file

@ -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"

View file

@ -21,8 +21,8 @@
state: up
type: bridge
ip:
dhcp4: no
auto6: yes
dhcp4: false
auto6: true
roles:
- linux-system-roles.network

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -34,7 +34,7 @@
interface_name: "{{ interface }}"
state: up
type: ethernet
autoconnect: yes
autoconnect: true
ip:
address: 192.0.2.1/24
roles:

View file

@ -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 }}

View file

@ -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 }}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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:

View file

@ -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 }}

View file

@ -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

View file

@ -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