Commit graph

891 commits

Author SHA1 Message Date
Rich Megginson
6dc78cba11 docs(changelog): version 1.17.3 [citest skip]
Update changelog and .README.html for version 1.17.3

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-07-02 16:43:30 -06:00
Rich Megginson
65e74567d4 refactor: support Ansible 2.19
The big problem was trying to use `vars` with `import_playbook`.

We do not need to use `import_playbook` when `include_tasks` will
work.  Perhaps the original author of these tests thought that
the play `roles` keyword was the only way to invoke roles, so
that had to be "called" using an `import_playbook`?

Use `include_tasks` instead of `import_playbook`, and move some
of those "tasks" playbooks to be tasks files in tests/tasks.

Use `include_role` instead of `import_role`.

Do not set variables using `set_fact` if they have already been
set at the appropriate scope using `vars`.

"Modernize" the code somewhat.

Improve formatting.

Work around an Ansible bug https://github.com/ansible/ansible/issues/85394

Fix ansible-lint and ansible-test issues related newer versions of
those tools.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-07-02 14:42:43 -06:00
Rich Megginson
14f9044bfc test: improve method for finding secondary interface
In some cases, the interface given in MAC_ADDR_MATCH_INTERFACE can be an
alias or altname.  The test cannot use the altname, it must use the "real"
interface name.

For example, on some systems, if `MAC_ADDR_MATCH_INTERFACE=enX1`, the test
will fail because it is an altname for `ens4`:

```
+ ip addr show enX1
3: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:00:12:34:57 brd ff:ff:ff:ff:ff:ff
    altname enp0s4
    altname enx525400123457
    altname enX1
```

The test will now parse the output of `ip addr show $name` to get the real interface name.

Also, improve the fallback method to look for common secondary interface names
such as eth1 and ens4 in case MAC_ADDR_MATCH_INTERFACE is not one of these.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-06-25 07:38:25 -06:00
Rich Megginson
592ad679de ci: Use ansible 2.19 for fedora 42 testing; support python 3.13
NOTE: This also requires upgrading to tox-lsr 3.11.0

Ansible 2.19 will be released soon and has some changes which will
require fixes in system roles.  This adds 2.19 to our testing matrix
on fedora 42 so that we can start addressing these issues.

python 3.13 is now being used on some platforms.

Using ansible-core 2.18 requires using py311 for pylint and other
python checkers.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-06-10 08:57:02 -06:00
Rich Megginson
0748c5d500 ci: Use ansible 2.19 for fedora 42 testing; support python 3.13
NOTE: This also requires upgrading to tox-lsr 3.11.0

Ansible 2.19 will be released soon and has some changes which will
require fixes in system roles.  This adds 2.19 to our testing matrix
on fedora 42 so that we can start addressing these issues.

python 3.13 is now being used on some platforms.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-06-10 08:57:02 -06:00
Rich Megginson
bc339a17f4 ci: Add support for bootc end-to-end validation tests
NOTE: This also requires upgrading to tox-lsr 3.10.0, and some
hacks to workaround a podman issue in ubuntu.

These tests run the role during a bootc container image build, deploy
the container into a QEMU VM, boot that, and validate the expected
configuration there. They run in two different tox environments, and
thus have to be run in two steps (preparation in buildah, validation in
QEMU). The preparation is expected to output a qcow2 image in
`tests/tmp/TESTNAME/qcow2/disk.qcow2`, i.e. the output structure of
<https://github.com/osbuild/bootc-image-builder>.

There are two possibilities:

* Have separate bootc end-to-end tests. These are tagged with
`tests::bootc-e2` and are skipped in the normal qemu-* scenarios.
They run as part of the container-* ones.

* Modify an existing test: These need to build a qcow2 image exactly
*once* (via calling `bootc-buildah-qcow.sh`) and skip setup/cleanup
and role invocations in validation mode, i.e. when
`__bootc_validation` is true.

In the container scenario, run the QEMU validation as a separate step in
the workflow.

See https://issues.redhat.com/browse/RHEL-88396

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-06-03 16:36:50 -06:00
Rich Megginson
d1083aa289 ci: get rid of integration tests - broken, unmaintained
The container based integration tests are broken and
unmaintained.  We don't need them anymore anyway.

If you want to run tests in a container, use tox-lsr.
https://github.com/linux-system-roles/tox-lsr?tab=readme-ov-file#container-testing

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-05-19 15:56:13 -06:00
Rich Megginson
c0b8196731 ci: Add Fedora 42; use tox-lsr 3.9.0; use lsr-report-errors for qemu tests
Add Fedora 42 to testing farm test matrix, drop Fedora 40

Use tox-lsr 3.9.0 for the `--lsr-report-errors-url` argument.

Add the argument `--lsr-report-errors-url DEFAULT` to the qemu test so that
the errors will be written to the output log.  This uses the output callback
https://github.com/linux-system-roles/auto-maintenance/blob/main/callback_plugins/lsr_report_errors.py

Use the check_logs.py script
https://github.com/linux-system-roles/auto-maintenance/blob/main/check_logs.py
with the `--github-action-format` argument to format the errors
in a github action friendly manner.

Rename the log files `-FAIL.log` or `-SUCCESS.log` depending on status.
This is compatible with the way the testing farm log files are named, and
makes it easy to tell if a test passed or failed from the log file name.

Upload README.html as artifacts of the build_docs job for debugging

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-05-19 14:28:25 -06:00
Rich Megginson
4ee6959c18 ci: bump tox-lsr to 3.8.0; rename qemu/kvm tests
This will make the qemu/kvm tests be tested in either
ascending or descending ASCII order.  This should give
us better test coverage of clean up scenarios which may
fail depending on the order of the previous tests.

Rename the qemu/kvm tests so that the statuses are shorter
and more intuitive.

Improve qemu/kvm test failure error reporting.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-05-08 07:40:35 +02:00
dependabot[bot]
38a3e080ae ci: bump sclorg/testing-farm-as-github-action from 3 to 4
Bumps [sclorg/testing-farm-as-github-action](https://github.com/sclorg/testing-farm-as-github-action) from 3 to 4.
- [Release notes](https://github.com/sclorg/testing-farm-as-github-action/releases)
- [Commits](https://github.com/sclorg/testing-farm-as-github-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: sclorg/testing-farm-as-github-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-01 11:52:01 -04:00
Rich Megginson
3e9c62bd6f docs(changelog): version 1.17.2 [citest skip]
Update changelog and .README.html for version 1.17.2

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-04-23 13:56:19 -06:00
Rich Megginson
dbe4af87fa ci: skip storage scsi, nvme tests in github qemu ci
These tests are problematic in github qemu tests, and that
functionality (scsi, anyway) in the testing farm integration
tests.

Yes, we should have a way to provide tags on a per-role basis . . .

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-04-22 15:48:50 -06:00
Rich Megginson
83c06d562b test: skip initscript related tests on Fedora 41 and later
Support for network-scripts has been removed from Fedora 41
https://discussion.fedoraproject.org/t/f41-change-proposal-removing-network-scripts-package-system-wide/118553
Skip the tests because they fail.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-04-22 15:38:17 -06:00
Rich Megginson
fcbf9020eb bump timeout to 8 minutes for mac80211_hwsim kernel modules
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-04-22 07:04:49 -06:00
Rich Megginson
217645869a test: exclude qemu interfaces from dhcp
When running tests with a qemu managed node, the dhcp
used by qemu interferes with the dhcp used in the test, which
can cause the test to hang.  Exclude the qemu interfaces from
using the test dhcp.  Note that this only affects the qemu tests -
testing farm and other tests with "real" machines will have a
different mac address - the mac addresses used below are specific
to qemu virtual devices.

Also, just in case tests still timeout, add a tests/ansible.cfg
with a 240 second task timeout to ensure any hung tasks are killed.
This will cause the playbook to exit with an error.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-04-22 07:04:49 -06:00
Rich Megginson
f75b203f9b ci: use tox-lsr 3.6.0; improve qemu test logging
tox-lsr 3.6.0 will guarantee order of qemu test execution, which should
help make tests reproducible and help debug test failures.

Improve qemu test logging - this will help debug the qemu test
failures.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-04-21 19:46:37 -06:00
Rich Megginson
7c73334ca5 test: find second interface to use for mac address match
Some systems do not use the `ethN` interface naming scheme, and
use `ensN` instead.  The test wants to use `eth1` as the second
interface.  If this does not exist, try `ens4` instead.
2025-04-15 16:24:27 -06:00
Rich Megginson
89297aa207 test: set shell to /bin/bash in order to use pipefail
Some of our tests now run on an ubuntu control node (localhost)
and use `shell` to execute commands there.  Ansible requires
the use of `pipefail`.  The default shell on ubuntu is not
bash and does not have `pipefail`.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-04-14 10:05:37 -06:00
Rich Megginson
75f15f1b05 ci: several changes related to new qemu test, ansible-lint, python versions, ubuntu versions
There is a new QEMU based test which uses the qemu/kvm capability of
github action runners.  This is the basis for new bootc/image mode tests
which we will be rolling out in the near future.

ansible-lint requires that the collection path is set so that the requirements
it installs are installed in the correct place.

There has been some general github action deprecation of python versions and
ubuntu versions that we have had to fix.

Remove `CONTRIBUTOR` from the list of users who can trigger citest.

For more information, see

* https://github.com/linux-system-roles/.github/pull/98
* https://github.com/linux-system-roles/.github/pull/94
* https://github.com/linux-system-roles/.github/pull/93
* https://github.com/linux-system-roles/.github/pull/92
* https://github.com/linux-system-roles/.github/pull/91

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-04-11 13:15:18 -06:00
Rich Megginson
07c7872456 test: add another network interface device for qemu tests
The latest version of standard-inventory-qcow2 adds support
for defining multiple network interface devices in the
provision.fmf file.  This is needed for network tests.

https://pagure.io/fork/rmeggins/standard-test-roles/c/4192f757f610fb6e3570806a282c9b744404ce4e?branch=linux-system-roles

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-04-10 14:03:36 -06:00
Wen Liang
d7c14f73f0 fix: Correct attribute checks for routing rule validation
The validation was incorrectly checking for routing rule attributes at the top-level
NM module instead of the NM.IPRoutingRule class. This was causing validation failures
because:

libnm's API has two core aspects:
1. NMConnection/NMSetting types for handling connection profiles
2. NMClient as a cache of D-Bus objects

The suppress_prefixlength and uid_range attributes are not part of the top-level NM
module but belong to NM.IPRoutingRule. Updated the validation to properly check for:
- set_suppress_prefixlength instead of NM_IP_ROUTING_RULE_ATTR_SUPPRESS_PREFIXLENGTH
- set_uid_range instead of NM_IP_ROUTING_RULE_ATTR_UID_RANGE_START

This aligns with the correct API usage and fixes the validation errors.

Resolves: https://issues.redhat.com/browse/RHEL-85872

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2025-04-09 18:18:57 -04:00
Wen Liang
fe7c6c6fd5 fix: Refine MAC validation using interface name
When a user provides both an interface name and a MAC address, the
current validation process retrieves sysfs link info separately using
the interface name and the MAC address, then compares the results. If
the information doesn't match, an error is raised.

However, this approach may trigger false alarms because retrieving the
link info by MAC might return the link info that only matches the
current MAC instead of the permanent MAC. Since the interface name is
unique within the kernel, a more robust validation method is to fetch
the MAC address using the interface name and then compare it directly
with the user-provided MAC address.

Resolves: https://issues.redhat.com/browse/RHEL-84362

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2025-03-31 22:25:32 -04:00
Wen Liang
cac2bbb43e fix: Remove MAC address matching from SysUtil.link_info_find()
The link_info_find() function previously allowed searching for links by
MAC address, but this introduced ambiguity and could cause false alarms
in certain cases (e.g. retrieving the link info by MAC might return the
link info that only matches the current MAC instead of the permanent
MAC). To ensure reliable behavior, this function should accept and match
the link info only by interface name.

To address the issues, the following changes were made:
- Removed MAC address matching logic to eliminate ambiguity.
- Simplified the function to only check ifname, making it more
  predictable.
- Updated all callers to adapt to this change, ensuring correctness.
- When a profile is tied to an interface via mac only, the validation of
  the existence of interface will now be delegated to NetworkManager
instead.

Resolves: https://issues.redhat.com/browse/RHEL-84197

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2025-03-31 22:21:18 -04:00
Sergei Petrosian
6a5ca9309e ci: Fix bug with ARTIFACTS_URL after prefixing with SR_
Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2025-03-21 00:09:16 +01:00
Sergei Petrosian
a58347f31a ci: In test plans, prefix all relate variables with SR_
Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2025-03-19 17:30:46 +01:00
Rich Megginson
e5aca936e5 test: do not need to install from epel or pip
The tests should not install anything from outside of the distribution
unless absolutely necessary, like the copr repos.

All of the EPEL dependencies have been removed or replaced
with coprs.

We do not need to install pytest from pip since it is available
as `pytest-3` from `python3-pytest`.

We do not need `git` or `rsync` in the tests.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-03-17 12:02:42 -06:00
Sergei Petrosian
53be949a5b ci: Add test plan that runs CI tests and customize it for each role
* Calculate number of managed nodes with this formula:
    (( number_of_test_playbooks / 10 + 1 ))
* Add README explaining how to run the plan locally and remotely

Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2025-02-17 15:49:27 +01:00
Sergei Petrosian
62d3bdc110 ci: Check spelling with codespell
* You can ignore words inline by adding a comment like `# codespell:ignore word`.
* You can ignore words by adding them to the `.codespell_ignores` file.
* You can ignore files and directories by adding them with `skip = ` to the `.codespellrc` file.

Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2025-02-14 11:06:01 +00:00
Sergei Petrosian
1b57520aa9 ci: Add test plan that runs CI tests and customize it for the network role
* Add 6 managed nodes to make tests faster
* Provision each test node with 2 NICs eth0 and eth1

Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2025-02-11 16:09:01 +01:00
Sergei Petrosian
3dc49b94cf ci: Add an additional NIC for test purposes
Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2025-02-07 16:53:02 +01:00
Rich Megginson
e890ab5813 refactor: fix python black formatting
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-01-31 08:02:52 -07:00
Rich Megginson
cb361ee3e3 ci: bump ansible-lint to v25; provide collection requirements for ansible-lint
There is a new version of ansible-lint - v25.
Newer versions of ansible-lint require the collection requirements to be
installed so it can find the modules/plugins.
Enhance our ansible-lint ci job to provide the collection requirements,
including merging the runtime meta/collection-requirements.yml with
the testing tests/collection-requirements.yml.
This should somewhat mitigate the loss of ansible-plugin-scan.
We have to remove mock_modules that are actually present now.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-01-31 05:14:18 -07:00
Rich Megginson
71e2855ee0 ci: ansible-plugin-scan is disabled for now
ansible-plugin-scan is broken due to lack of support for older versions
of python in ci.
One of the main reasons for using this scan is to check if the roles/tests
are using plugins that are not compatible with ansible 2.9.  Since 2.9
is EOL, this is no longer necessary.
The other reason for using the scan is to check that the role/test
author has correctly listed dependencies in meta/collection-requirements.yml
and tests/collection-requirements.yml - that is - that the author has
correctly specified the dependencies for any plugins used that are
not built-in.  This will mostly be caught in CI testing now.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-01-29 13:24:26 -07:00
Rich Megginson
2439f442cc docs(changelog): version 1.17.1 [citest skip]
Update changelog and .README.html for version 1.17.1

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-01-09 08:45:23 -07:00
Wen Liang
c34168318c fix: Prioritize find link info by permanent MAC address, with fallback to current address
Updated the link_info_find method to prioritize matching links by
perm-address when it is valid and available. If the perm-address is
unavailable (None or "00:00:00:00:00:00"), the method falls back to
matching by address. Additionally, if ifname is provided, it takes
precedence and returns the corresponding linkinfo immediately.

The change resolves scenarios where multiple network interfaces might
share the same current MAC address (address), leading to potential
ambiguity in link matching. By prioritizing the permanent MAC address
(perm-address), the method provides a more precise and consistent match.
This is particularly crucial in environments with:

- MAC address spoofing or dynamic changes, where the current MAC
  address may not reliably identify the interface.
- Virtual interfaces or VLANs, which often lack a valid perm-address
  and rely on the parent interface's address.
- Ambiguity when multiple interfaces share the same address.

This change improves the robustness of MAC address matching by ensuring
that permanent addresses are prioritized while maintaining a reliable
fallback mechanism for interfaces with no permanent address.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2025-01-07 15:07:37 -05:00
Rich Megginson
560173b5bf ci: Use Fedora 41, drop Fedora 39 - part two
Fedora 41 is released, and Fedora 39 will soon be unsupported
Part two - first part did not work

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2024-12-02 17:49:42 -07:00
Rich Megginson
bc17cbc490 ci: Use Fedora 41, drop Fedora 39
Fedora 41 is released, and Fedora 39 will soon be unsupported

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2024-12-02 13:49:38 -07:00
dependabot[bot]
7ba409fcce ci: bump codecov/codecov-action from 4 to 5
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 14:40:14 +01:00
Rich Megginson
70b7791f33 docs(changelog): version 1.17.0 [citest skip]
Update changelog and .README.html for version 1.17.0

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2024-10-30 18:50:26 -06:00
Wen Liang
d92baacf1f feat: Support wait_ip property
Add support for the `wait_ip` property, the system will consider
connection activated only when specific IP stack is configured.
This enables flexibility in scenarios such as
IPv6-only networks, where the overall network configuration can still
succeed when IPv4 configuration fails but IPv6 completes successfully.

The `wait_ip` can be configured with the following possible values:
  * "any": System will consider interface activated when any IP stack is
           configured.
  * "ipv4": System will wait IPv4 been configured.
  * "ipv6": System will wait IPv6 been configured.
  * "ipv4+ipv6": System will wait both IPv4 and IPv6 been configured.

Resolves: https://issues.redhat.com/browse/RHEL-63026

Signed-off-by: Wen Liang <wenliang@redhat.com>
2024-10-29 09:43:38 -04:00
Rich Megginson
38a61f76e9 refactor: Use vars/RedHat_N.yml symlink for CentOS, Rocky, Alma wherever possible
We have a lot of requests to support Rocky and Alma in various system roles. The
first part of adding support is adding `vars/` files for these platforms. In
almost every case, for a given major version N, the vars file RedHat_N.yml can
be used for CentOS, Rocky, and Alma.  Rather than making a copy of the
RedHat_N.yml file, just use a symlink to reduce size and maintenance burden, and
standardize this across all system roles for consistency.

NOTE: There is no Alma or Rocky version 7 or less.

NOTE: OracleLinux is not a strict clone, so we are not going to do this for
OracleLinux at this time.  Support for OracleLinux will need to be done in
separate PRs. For more information, see
https://github.com/linux-system-roles/cockpit/issues/130

**Question**: Why not just use `ansible_facts["os_family"] == "RedHat"`?

**Answer**:  This is what Ansible uses as the RedHat os_family:
1e6ffc1d02/lib/ansible/module_utils/facts/system/distribution.py (L511)
There are a lot of distributions in there. I know that Fedora is not a clone of
RHEL, but it is very closely related. Most of the others are not clones, and it
would generally not work to replace ansible_distribution in ['CentOS', 'Fedora',
'RedHat'] with ansible_facts['os_family'] == 'RedHat' (but it would probably
work in specific cases with specific distributions).  For example, OracleLinux
is in there, and we know that doesn't generally work.  The only ones we can be
pretty sure about are `RedHat`, `CentOS`, `Fedora`, `AlmaLinux`, and `Rocky`.

**Question**: Does my role really need this because it should already work on
RHEL clones?

**Answer**: Maybe not - but:

* it doesn't hurt anything
* it's there if we need it in the future
* the role will be inconsistent with the other system roles if we don't have this

**Question**: Why do I need the `tests/vars/rh_distros_vars.yml` file?  Doesn't
the test load the vars from the role?

**Answer**: No, the test does not load the vars from the role until the role is
included, and many tests use version and distribution before including the role.

**Question**: Do we need to change the code now to use the new variables?

**Answer**: No, not now, in subsequent PRs, hopefully by Alma and Rocky users.

Note that there may be more work to be done to the role to fully support Rocky
and Alma.  Many roles have conditionals like this:

```yaml
some_var: "{{ 'some value' if ansible_distribution in ['CentOS', 'RedHat'] else 'other value' }}"
another_var: "{{ 'some value' if ansible_distribution in ['CentOS', 'Fedora', 'RedHat'] else 'other value' }}"

...

- name: Do something
  when: ansible_distribution in ['CentOS', 'RedHat']
  ...
- name: Do something else
  when: ansible_distribution in ['CentOS', 'Fedora', 'RedHat']
  ...
```

Adding Rocky and AlmaLinux to these conditionals will have to be done
separately. In order to simplify the task, some new variables are being
introduced:

```yaml
__$rolename_rh_distros:
  - AlmaLinux
  - CentOS
  - RedHat
  - Rocky

__$rolename_rh_distros_fedora: "{{ __$rolename_rh_distros + ['Fedora'] }}"

__$rolename_is_rh_distro: "{{ ansible_distribution in __$rolename_rh_distros }}"
__$rolename_is_rh_distro_fedora: "{{ ansible_distribution in __$rolename_rh_distros_fedora }}"
```

Then the conditionals can be rewritten as:

```yaml
some_var: "{{ 'some value' if __$rolename_is_rh_distro else 'other value' }}"
another_var: "{{ 'some value' if __$rolename_is_rh_distro_fedora else 'other value' }}"

...

- name: Do something
  when: __$rolename_is_rh_distro | bool
  ...
- name: Do something else
  when: __$rolename_is_rh_distro_fedora | bool
  ...
```

For tests - tests that use such conditionals will need to use `vars_files` or
`include_vars` to load the variables that are defined in
`tests/vars/rh_distros_vars.yml`:

```yaml
vars_files:
  - vars/rh_distros_vars.yml
```

We don't currently have CI testing for Rocky or Alma, so someone wanting to run
tests on those platforms would need to change the test code to use these.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2024-10-25 12:06:55 -06:00
Wen Liang
46964caee5 docs: Add example for configuring a Linux Bridge using network_state variable
Signed-off-by: Wen Liang <wenliang@redhat.com>
2024-10-18 08:28:38 -04:00
Wen Liang
1630646a55 docs: Promote network_state variable as the future for network management
Signed-off-by: Wen Liang <wenliang@redhat.com>
2024-10-18 08:28:38 -04:00
Rich Megginson
f3f5aa6c83 ci: add YAML header to github action workflow files
Some github action workflow files were missing the YAML --- header.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2024-10-16 11:33:39 -06:00
Rich Megginson
a43638333b ci: ansible-test action now requires ansible-core version
The ansible-test github action does not use a supported version
of ansible-core by default.
https://github.com/ansible-community/ansible-test-gh-action?tab=readme-ov-file#ansible-core-version

We have to set it in our action.  Using `stable-2.17` as that is the latest stable version.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2024-10-15 14:33:13 -06:00
Wen Liang
5d73511d64 feat: Support autoconnect_retries
There is no fine-grained control over the number of retries for
automatically reconnecting a network connection in the role. This
limitation can be problematic for certain use cases where extending the
retry process is critical, particularly in environments with unstable
networks. Introduce support for the `autoconnect_retries` property in nm
provider of `network_connections` variable. This feature allows users to
configure how many times NetworkManager will attempt to reconnect a
connection after a autoconnect failure, providing more control over
network stability and performance.

Resolves: https://issues.redhat.com/browse/RHEL-61599

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2024-10-08 10:25:58 -04:00
Sergei Petrosian
b08aad243b ci: Add tags to TF workflow, allow more [citest bad] formats
* Add "BusinessUnit": "system_roles" environment setting to tag our jobs in Testing farm
* Add tmt_plan_filter to run additional workflows besides general
* Allow more [citest bad] comment formats
* Get memory and supported platforms info from the PR ref
* Move LINUXSYSTEMROLES_USER to vars and use it everywhere in tft.yml
* Remove extra GITHUB_ORG definition

Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2024-10-07 11:57:52 +02:00
Wen Liang
d6203012e5 docs: Explain where network state examples originate
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2024-09-06 10:21:44 -04:00
Rich Megginson
587a62e903 docs(changelog): version 1.16.5 [citest skip]
Update changelog and .README.html for version 1.16.5

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2024-08-29 19:14:32 -04:00
Wen Liang
7a476a71a4 docs: Remove invalid network state example
For an ethernet device which contains the kernel link, we should not
and cannot delete such a device using `network_state` variable.

We can only use `network_state` variable to delete the virtual NIC that
is created by NM/Nmstate.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2024-08-28 08:23:40 -04:00