mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 10:25:28 +00:00
The old ansible-community ansible-lint is deprecated. There is a new ansible-lint github action. The new ansible-lint has several checks related to ansible-test and the ignore files. Many of our ignore settings are not allowed any more and are required to be fixed or addressed in the Ansible preferred way. The python imports have to be wrapped in a try/except ImportError, and where possible, an error must be returned from the module explaining what was not able to be imported. The module documentation must comply with the Ansible standards. One aspect of this is the `version_added` must be a valid ansible-core version in X.Y.Z format. Note that this version isn't really used anywhere, so it doesn't matter for users of the role, it is purely an `ansible-test` and import gating issue. The result of this is that the .sanity files can be reduced to the bare minimum which will greatly reduce the maintenance burden of those files, make it easier to support newer versions of Ansible, and make it easier to import the system roles collection into Galaxy and Automation Hub. The latest Ansible repo gating tests run ansible-lint against the collection format instead of against individual roles. We have to convert the role to collection format before running ansible-test. Role developers can run this locally using `tox -e collection,ansible-lint-collection` See https://github.com/linux-system-roles/tox-lsr/pull/125 Add `---` doc start to .markdownlint.yaml The file `examples/down_profile+delete_interface.yml` was not used and was causing ansible-lint errors. ansible-lint enforces the order of keywords in plays - `name`, then `hosts`, then `vars`, then `tasks`. Signed-off-by: Rich Megginson <rmeggins@redhat.com>
45 lines
1.5 KiB
YAML
45 lines
1.5 KiB
YAML
# SPDX-License-Identifier: BSD-3-Clause
|
|
# This file was generated by ensure_provider_tests.py
|
|
---
|
|
# set network provider and gather facts
|
|
# yamllint disable rule:line-length
|
|
- name: Run playbook 'playbooks/tests_ethtool_features.yml' with nm as provider
|
|
hosts: all
|
|
tasks:
|
|
- name: Include the task 'el_repo_setup.yml'
|
|
include_tasks: tasks/el_repo_setup.yml
|
|
- name: Set network provider to 'nm'
|
|
set_fact:
|
|
network_provider: nm
|
|
tags:
|
|
- always
|
|
|
|
- name: Install NetworkManager and get NetworkManager version
|
|
when:
|
|
- ansible_distribution_major_version != '6'
|
|
tags:
|
|
- always
|
|
block:
|
|
- name: Install NetworkManager
|
|
package:
|
|
name: NetworkManager
|
|
state: present
|
|
use: "{{ (__network_is_ostree | d(false)) |
|
|
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
|
|
- name: Get package info
|
|
package_facts:
|
|
- name: Get NetworkManager version
|
|
set_fact:
|
|
networkmanager_version: "{{
|
|
ansible_facts.packages['NetworkManager'][0]['version'] }}"
|
|
|
|
|
|
# The test requires or should run with NetworkManager, therefore it cannot run
|
|
# on RHEL/CentOS 6
|
|
# NetworkManager 1.20.0 introduced ethtool settings support
|
|
- name: Import the playbook 'playbooks/tests_ethtool_features.yml'
|
|
import_playbook: playbooks/tests_ethtool_features.yml
|
|
when:
|
|
- ansible_distribution_major_version != '6'
|
|
|
|
- networkmanager_version is version('1.20.0', '>=')
|