Commit graph

21 commits

Author SHA1 Message Date
Rich Megginson
a1129dd121 fix: cannot use community-general version 12 - no py27 and py36 support
community.general version 12 has dropped support for py27 and py36 - ensure that
the roles do not install/use this version - see
https://github.com/ansible-collections/community.general/issues/582

By default, installation will get the latest 11.x version. The lower bound
`6.6.0` is an older version, but I don't want to restrict the ability of a user
of a particular role to use an old version, rather than forcing them to use
`11.x` or later. Some roles like `rhc` explicitly require `6.6.0` or later - I
think this is a reasonable lower bound for all roles.If a role needs a different
version, the role can define its own `community_general_version` in the role's
`host_vars` file in .github.

Standardize file format across all roles for consistency and ease of updating

This update may remove the SPDX license information from the file - this is ok -
the role/project already has a license, this file is trivial, and many
requirements files do not have the license header anyway.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2025-11-15 10:49:31 -05:00
Rich Megginson
9e6e150a6e fix: add support for EL10
According to the Ansible team, support for listing platforms in
role `meta/main.yml` files is being removed.
Instead, they recommend using `galaxy_tags`

https://github.com/ansible/ansible/blob/stable-2.17/changelogs/CHANGELOG-v2.17.rst
"Remove the galaxy_info field platforms from the role templates"
https://github.com/ansible/ansible/issues/82453

Many roles already have tags such as "rhel", "redhat", "centos", and "fedora".
I propose that we ensure all of the system roles have these tags.
Some of our roles support Suse, Debian, Ubuntu, and others.
We should add tags for those e.g. the ssh role already has tags for "debian" and "ubuntu".

In addition - for each version listed under `platforms.EL` - add a tag like `elN`.

Q: Why not use a delimiter between the platform and the version e.g. `el-10`?

This is not allowed by ansible-lint:

```
meta-no-tags: Tags must contain lowercase letters and digits only., invalid: 'el-10'
meta/main.yml:1
```

So we cannot use uppercase letters either.

Q: Why not use our own meta/main.yml field?

No other fields are allowed by ansible-lint:

```
syntax-check[specific]: 'myfield' is not a valid attribute for a RoleMetadata
```

Q: Why not use some other field?

There are no other applicable or suitable fields.

Q: What happens when we want to support versions like `N.M`?

Use the word "dot" instead of "." e.g. `el10dot3`.
Similarly - use "dash" instead of "-".

We do not need tags such as `fedoraall`.
The `fedora` tag implies that the role works on all supported versions of fedora.
Otherwise, use tags such as `fedora40` if the role only supports specific versions.

Teaming support is dropped in EL10.  Provide an error to users who attempt
to use teaming and suggest that they use bonding instead.  Skip teaming
tests on EL10.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2024-07-02 09:09:05 -06:00
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
Rich Megginson
9a16583783 feat: support for ostree systems
Feature: Allow running and testing the role with ostree managed nodes.

Reason: We have users who want to use the role to manage ostree
systems.

Result: Users can use the role to manage ostree managed nodes.

NOTE: The .ostree/packages-*.txt are generated by running the
script https://github.com/linux-system-roles/auto-maintenance/blob/main/check-logs-for-packages.sh
which is used with an integration test CI run with the
https://github.com/linux-system-roles/auto-maintenance/blob/main/callback_plugins/dump_packages.py
plugin.  An example of such a CI run is
https://github.com/linux-system-roles/network/pull/647

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-10-30 12:02:20 -06:00
Rich Megginson
cf356230ca support ansible-core-2.14, ansible-lint 6.x
ansible-core 2.14 is now the current version of Ansible.  This version
does not support `args: warn: false` so we have to remove it from the
network role.  Users will need to use `COMMAND_WARNINGS` in their
Ansible configuration in order to suppress the warning in older versions
of Ansible such as 2.9, 2.11.
In addition, the gating tests are getting stricter about using new best
practices, such as using `true`, `false` for booleans instead of `yes`,
`no`; use of spaces in Jinja expressions; etc.  These issues were
addressed.
The `tests/` directory contains far too many cases of non-recommended
practices, so this directory has been exempted.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2022-11-14 13:54:14 -07:00
Rich Megginson
4d21dcd0ac [citest skip] make min_ansible_version a string in meta/main.yml
The Ansible developers say that `min_ansible_version` in meta/main.yml
must be a `string` value like `"2.9"`, not a `float` value like `2.9`.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2022-06-29 07:07:31 -06:00
Sergei Petrosian
133672663d Drop support for Ansible 2.8 by bumping the Ansible version to 2.9
Bug 1989197 - drop support for Ansible 2.8
https://bugzilla.redhat.com/show_bug.cgi?id=1989197

Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2021-08-12 17:08:05 +08:00
Jakub Haruda
6fdac168a9 CI: Add support for RHEL-9
Signed-off-by: Jakub Haruda <jharuda@redhat.com>
2021-05-28 06:06:51 +08:00
Jakub Haruda
899edea426 meta/main.yml: CI - Add support for all Fedora images
Signed-off-by: Jakub Haruda <jharuda@redhat.com>
2020-11-30 14:05:24 +08:00
Rich Megginson
35a09bbc61 use github_branch: main for galaxy import
Galaxy imports of the network role are failing:
https://galaxy.ansible.com/my-imports/1710
```
Task "703539" failed: Command '['git', 'clone', '--quiet', '--depth', '1', '--branch', 'master', 'https://github.com/linux-system-roles/network.git', '/var/tmp/galaxy/imports/tmpnxdxwzmg']' returned non-zero exit status 128.
```
We need to tell galaxy to use `main` instead of `master`.  The galaxy
roles documentation says that `github_branch` may be used for this
purpose:
https://galaxy.ansible.com/docs/contributing/creating_role.html#role-metadata

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2020-09-08 19:57:59 +02:00
Till Maas
0afed7ed88 Meta: Update Fedora releases 2020-05-05 11:14:01 +02:00
Till Maas
da35b81b2b Meta: Update minimum Ansible version 2020-04-17 17:25:07 +02:00
Till Maas
6cfcfc430c Defaults: Remove conditions for unsupported Fedora releases 2019-11-27 16:54:22 +01:00
Till Maas
0c59fe1c6a Cleanup yaml files for molecule lint 2019-04-25 14:19:15 +02:00
Till Maas
a2380ece03 meta: Update distribution versions 2019-04-25 14:15:08 +02:00
Till Maas
d7152a5502 meta: Update Author 2019-04-25 14:15:08 +02:00
Pavel Cahyna
b144a026b4 Add Fedora 29 support to Galaxy metadata 2018-11-14 15:53:32 +01:00
Pavel Cahyna
8369b953cc Update Galaxy tags.
Remove beta and add tags.

Update the OS versions and Ansible version (2.5 because of service_facts).
2018-08-21 20:47:38 +02:00
Till Maas
f0d0e0637b Add SPDX-License-Identifier headers 2018-03-13 10:06:30 +01:00
Lars Karlitski
9b21e84f47 Update meta data and add COPYING 2017-04-28 12:35:06 +02:00
Thomas Haller
ac35802240 first version 2016-12-05 18:14:20 +01:00