ansible-lint 6.x updates

The only thing we need to skip currently is using FQCN for ansible
builtin modules, plugins
Add `kinds` - otherwise, Ansible thinks anything not in a traditional
role path is a plain YAML file, and we don't get the additional
checking.
Ensure all plays are named.
Fix some other minor problems.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
This commit is contained in:
Rich Megginson 2023-01-04 09:55:08 -07:00 committed by Richard Megginson
parent 586b0ec120
commit 2e8ac7aa66
28 changed files with 68 additions and 35 deletions

View file

@ -1,10 +1,19 @@
---
exclude_paths:
- tests/
- .github/
- .ansible-lint
skip_list:
- role-name
- fqcn
- fqcn-builtins
warn_list:
- load-failure # allow include_tasks with tasks/ directory
exclude_paths:
- tests/
- tests/roles/
- .github/
- examples/roles/
kinds:
- playbook: "**/tests/tests_*.yml"
- playbook: "**/tests/setup-snapshot.yml"
- tasks: "**/tests/*.yml"
- playbook: "**/tests/playbooks/*.yml"
- tasks: "**/tests/tasks/*.yml"
- tasks: "**/tests/tasks/*/*.yml"
- vars: "**/tests/vars/*.yml"
- playbook: "**/examples/*.yml"

View file

@ -1,6 +1,6 @@
# SPDX-License-Identifier: MIT
---
extends: yamllint_defaults.yml
extends: default
# possible customizations over the base yamllint config
# skip the yaml files in the /tests/ directory
# NOTE: If you want to customize `ignore` you'll have to
@ -19,7 +19,6 @@ ignore: |
tests/roles/
.tox/
rules:
truthy: disable
line-length:
ignore: |
/tests/tasks/setup_mock_wifi_wpa3_owe.yml

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: network-test
- name: Manage bond options
hosts: network-test
vars:
network_connections:
# Specify the bond profile

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: network-test
- name: Manage bond connection
hosts: network-test
vars:
network_connections:
# Specify the bond profile

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: network-test
- name: Manage bond with VLAN
hosts: network-test
vars:
network_connections:
# Create a bond profile, which is the parent of VLAN.

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: network-test
- name: Manage bridge with VLAN
hosts: network-test
vars:
network_connections:
# Create a bridge profile, which is the parent of VLAN.

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: network-test
- name: Manage cloned MAC
hosts: network-test
vars:
network_connections:
# specify the bond profile

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: all
- name: Example of profile management
hosts: all
vars:
network_connections:
# Specify the dummy profile

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: all
- name: Manage DNS settings
hosts: all
vars:
network_connections:
- name: eth0

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: network-test
- name: Manage autoconnect
hosts: network-test
vars:
network_connections:
# Create one ethernet profile and activate it.

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: network-test
- name: Manage 802.1x with certs
hosts: network-test
vars:
network_connections:
- name: eth0
@ -22,6 +23,7 @@
copy:
src: "{{ item }}"
dest: /etc/pki/tls/{{ item }}
mode: 0600
with_items:
- client.key
- client.pem

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: network-test
- name: Manage ethernet with VLAN
hosts: network-test
vars:
network_connections:
# Create a profile for the underlying device of the VLAN.

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: all
- name: Manage ethernet coalesce
hosts: all
tasks:
- name: Configure ethernet coalesce
include_role:

View file

@ -1,8 +1,9 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: all
- name: Manage ethernet parameters
hosts: all
tasks:
- name: Configure ethernet paramters
- name: Configure ethernet parameters
include_role:
name: linux-system-roles.network
vars:

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: all
- name: Manage ethernet features
hosts: all
tasks:
- name: Configure ethernet features
include_role:

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: all
- name: Manage ethtool ring
hosts: all
tasks:
- name: Configure ring parameters
include_role:

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: network-test
- name: Manage inifiniband example
hosts: network-test
vars:
network_connections:
- name: ib0

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: all
- name: Disable ipv6
hosts: all
vars:
network_connections:
- name: eth0

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: network-test
- name: Manage network MAC VLAN
hosts: network-test
vars:
network_connections:
- name: eth0

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: all
- name: Manage network using match path for interface
hosts: all
vars:
network_connections:
- name: eth0

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: all
- name: Manage network using network_state
hosts: all
vars:
network_state:
interfaces:

View file

@ -1,6 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- name: Set {{ profile }} down
- name: Set down profile {{ profile }}
hosts: all
vars:
network_connections:

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: all
- name: Manage routing tables
hosts: all
tasks:
- name: Add a new routing table
lineinfile:

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: network-test
- name: Manage teaming
hosts: network-test
vars:
network_connections:
# Specify the team profile

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: all
- name: Manage Wireless with OWE
hosts: all
vars:
network_connections:
- name: wlan0

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: network-test
- name: Manage WPA3 with SAE
hosts: network-test
vars:
network_connections:
- name: wlan0

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause
---
- hosts: network-test
- name: Manage WPA PSK
hosts: network-test
vars:
network_connections:
- name: wlan0

View file

@ -74,7 +74,7 @@
# ansible-lint wants this to be a handler, but this is not appropriate as
# NetworkManager must be restarted prior to the connections being created.
# see (https://docs.ansible.com/ansible-lint/rules/default_rules.html)
- __network_package_install.changed # noqa 503
- __network_package_install.changed # noqa no-handler
- name: Enable and start NetworkManager
service: