network/tests/tasks
Rich Megginson 0c590cdf5a refactor: improve support for ostree systems
The dependency on `ansible.utils.update_fact` is causing issue with
some users who now must install that collection in order to run
the role, even if they do not care about ostree.

The fix is to stop trying to set `ansible_facts.pkg_mgr`, and instead
force the use of the ostree package manager with the `package:` module
`use:` option.  The strategy is - on ostree systems, set the flag
`__$ROLENAME_is_ostree` if the system is an ostree system.  The flag
will either be undefined or `false` on non-ostree systems.
Then, change every invocation of the `package:` module like this:

```yaml
- name: Ensure required packages are present
  package:
    name: "{{ __$ROLENAME_packages }}"
    state: present
    use: "{{ (__$ROLENAME_is_ostree | d(false)) |
      ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
```

This should ensure that the `use:` parameter is not used if the system
is non-ostree.  The goal is to make the ostree support as unobtrusive
as possible for non-ostree systems.
The user can also set `__$ROLENAME_is_ostree: true` in the inventory or play
if the user knows that ostree is being used and wants to skip the check.
Or, the user is concerned about the performance hit for ostree detection
on non-ostree systems, and sets `__$ROLENAME_is_ostree: false` to skip
the check.
The flag `__$ROLENAME_is_ostree` can also be used in the role or tests to
include or exclude tasks from being run on ostree systems.

This fix also improves error reporting in the `get_ostree_data.sh` script
when included roles cannot be found.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-11-29 07:05:00 -07:00
..
provider ansible-lint: Fix yaml[truthy] failures 2023-02-20 15:00:28 +01:00
activate_profile.yml add support for ansible-core 2.11 ansible-lint, ansible-test 2021-10-11 12:03:00 -06:00
assert_device_absent.yml ansible-lint: Fix name[missing] and name[play] failures 2023-04-10 17:49:07 +02:00
assert_device_present.yml ansible-lint: Fix name[missing] and name[play] failures 2023-04-10 17:49:07 +02:00
assert_output_in_stderr_without_warnings.yml library: Separate debug and info logs from warnings 2020-05-06 21:57:34 +02:00
assert_profile_absent.yml ansible-lint: Fix name[missing] and name[play] failures 2023-04-10 17:49:07 +02:00
assert_profile_present.yml ansible-lint: Fix name[missing] and name[play] failures 2023-04-10 17:49:07 +02:00
cleanup_802_1x_server.yml Cleaning up ansible-lint errors except '106', '303' and '403' 2021-04-15 20:53:53 +02:00
cleanup_mock_wifi.yml Cleaning up ansible-lint errors except '106', '303' and '403' 2021-04-15 20:53:53 +02:00
cleanup_profile+device.yml add support for ansible-core 2.11 ansible-lint, ansible-test 2021-10-11 12:03:00 -06:00
create_and_remove_interface.yml ansible-lint: Fix name[missing] and name[play] failures 2023-04-10 17:49:07 +02:00
create_bridge_profile.yml add support for ansible-core 2.11 ansible-lint, ansible-test 2021-10-11 12:03:00 -06:00
create_bridge_profile_no_autoconnect.yml add support for ansible-core 2.11 ansible-lint, ansible-test 2021-10-11 12:03:00 -06:00
create_dummy_profile.yml add support for ansible-core 2.11 ansible-lint, ansible-test 2021-10-11 12:03:00 -06:00
create_team_profile.yml add support for ansible-core 2.11 ansible-lint, ansible-test 2021-10-11 12:03:00 -06:00
create_test_interfaces_with_dhcp.yml refactor: improve support for ostree systems 2023-11-29 07:05:00 -07:00
delete_interface.yml ansible-lint: Fix name[casing] warnings 2023-03-27 16:25:03 +02:00
el_repo_setup.yml refactor: improve support for ostree systems 2023-11-29 07:05:00 -07:00
enable_epel.yml fix: Install yum-utils package 2023-10-05 15:11:02 -06:00
get_current_interfaces.yml Cleaning up ansible-lint errors except '106', '303' and '403' 2021-04-15 20:53:53 +02:00
get_interface_stat.yml Rename files to be valid python identifiers 2020-04-22 17:40:03 +02:00
get_modules_and_utils_paths.yml ansible-lint: Fix name[casing] warnings 2023-03-27 16:25:03 +02:00
get_NetworkManager_NVR.yml ansible-lint: Fix name[missing] and name[play] failures 2023-04-10 17:49:07 +02:00
get_profile_stat.yml Fingerprint RHEL System Role managed config files 2023-03-30 13:38:19 -06:00
manage_test_interface.yml refactor: improve support for ostree systems 2023-11-29 07:05:00 -07:00
remove+down_profile.yml add support for ansible-core 2.11 ansible-lint, ansible-test 2021-10-11 12:03:00 -06:00
remove_profile.yml add support for ansible-core 2.11 ansible-lint, ansible-test 2021-10-11 12:03:00 -06:00
remove_test_interfaces_with_dhcp.yml test: Fix the bond test on DHCP 2021-07-28 19:50:09 +08:00
run_test.yml ansible-lint: Fix name[missing] and name[play] failures 2023-04-10 17:49:07 +02:00
setup_802.1x.yml style: ansible-lint - fix missing YAML document start 2023-04-28 09:15:50 -06:00
setup_802_1x_server.yml refactor: improve support for ostree systems 2023-11-29 07:05:00 -07:00
setup_mock_wifi.yml refactor: improve support for ostree systems 2023-11-29 07:05:00 -07:00
setup_mock_wifi_wpa3_owe.yml refactor: improve support for ostree systems 2023-11-29 07:05:00 -07:00
setup_mock_wifi_wpa3_sae.yml refactor: improve support for ostree systems 2023-11-29 07:05:00 -07:00
setup_test_interface.yml ansible-lint: Fix name[missing] and name[play] failures 2023-04-10 17:49:07 +02:00
show_interfaces.yml ansible-lint: Fix name[missing] and name[play] failures 2023-04-10 17:49:07 +02:00
start_mock_wifi.yml wifi: Add Opportunistic Wireless Encryption (OWE) support 2021-05-24 10:51:01 +08:00
test_802.1x_capath.yml refactor: improve support for ostree systems 2023-11-29 07:05:00 -07:00