Commit graph

927 commits

Author SHA1 Message Date
dependabot[bot]
d21b60f30d ci: bump actions/github-script from 6 to 7
Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-01 14:56:36 -07:00
Wen Liang
ed93bed847 refractor: Use meaningful variable
Some variables used in the module code are not meaningful at all, which
might be hard to read and understand. Therefore, replace them with
meaningful variables.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-12-01 13:39:57 -07:00
Rich Megginson
11fa80a74b docs(changelog): version 1.14.1 [citest skip]
Update changelog and .README.html for version 1.14.1

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-11-30 08:49:58 -07:00
Wen Liang
7c4f11f1d9 tests: Fix tests_network_state_nm.yml CI failure
Since the merge of nmstate commit 'nm dns: Support appending static DNS
before dynamic DNS' (https://github.com/nmstate/nmstate/pull/2438),
nmstate treats interface with `auto-dns: true` as valid to store DNS
and tries to use NetworkManager global DNS as much as possible. However,
in NM, `dns=systemd-resolved` does not support global DNS configuration,
because systemd-resolved only supports per-interface DNS servers (via
the D-Bus API). Therefore, write and validate the DNS configuration in
/run/NetworkManager/no-stub-resolv.conf, which contains the original
DNS settings pushed to the DNS plugin.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-11-29 16:29:50 -07: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
Wen Liang
c7a31e7079 fix: Allow address 0.0.0.0/0 or ::/0 for 'from'/'to' in routing rule validation
`from 0.0.0.0/0` means from all IPv4 addresses, `from ::/0` means from
all IPv6 addresses. In NM, if `from` property is not specified in a
routing rule, NM still appends `from 0.0.0.0/0` or `from ::/0` to the
rule. NM also allows to specify `to 0.0.0.0/0` or `to ::/0` in a
routing rule, but the connection profiles will only show the `from`
setting for the rule.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-11-13 14:06:53 -07:00
Rich Megginson
815b5b0cc5 docs(changelog): version 1.14.0 [citest skip]
Update changelog and .README.html for version 1.14.0

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-11-09 14:26:53 -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
Wen Liang
712f1dfcf4 docs(changelog): Fix wrong format in version 1.13.2
The changelog update for version 1.13.2 contains wrongly formatted
content which makes the changelog file update inconsistent from
previous release.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-10-26 08:12:48 -06:00
Rich Megginson
b940af74a6 docs(changelog): version 1.13.3 [citest skip]
Update changelog and .README.html for version 1.13.3

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-10-24 07:51:38 -06:00
Rich Megginson
a9f20cb87b ci: tox-lsr version 3.1.1
This is primarily for the update to ansible-plugin-scan to
work with the upcoming ostree changes, but also includes
some minor fixes which affect ci.
3.1.0 was released but not used due to a bug fixed in 3.1.1
See full release notes for 3.1.0 and 3.1.1
https://github.com/linux-system-roles/tox-lsr/releases

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-10-11 08:25:08 -06:00
Rich Megginson
e82aca60d0 ci: use dump_packages.py callback to get packages used by role
This adds the dump_packages.py callback which will dump the
arguments to the `package` module (except for `state: absent`)
to the integration test run logs.  The output looks like this:
`lsrpackages: pkg-a pkg-b ...`
We will have tooling which will scrape the logs to extract the
packages used at runtime and testing for all of the supported
combinations of distribution and version.

This also ensures the weekly-ci PR git commit message conforms
to commitlint.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-10-05 18:01:49 -06:00
Rich Megginson
2d41de3412 docs: Ensure badges are sorted consistently
Ensure badges are sorted so that future updates are
consistent and in a stable order.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-10-05 17:39:51 -06:00
Rich Megginson
3ff75152c2 ci: ensure dependabot git commit message conforms to commitlint
Ensure dependabot git commit message conforms to commitlint

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-10-05 17:39:51 -06:00
Wen Liang
ca2180e659 test: Remove bond tests tag expfail
Since the root cause of the bond tests failure is already found and
fixed (by the commit 'fix: Add dhcp client package dependency for
initscripts provider'). Therefore, remove the bond tests tag `expfail`
and enable the bond tests in the downstream testing.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-10-05 15:11:02 -06:00
Wen Liang
62c78f4fe0 fix: Add dhcp client package dependency for initscripts provider
Initscripts provider requires `/sbin/dhclient` to obtain DHCP address,
which is shipped in dhcp client package. But the managed hosts may not
already install the dhcp client package, thus, add it as the dependency
package for initscripts provider.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-10-05 15:11:02 -06:00
Wen Liang
17922ca6f3 fix: Install yum-utils package
`yum-config-manager` is provided by the yum-utils package, thus, install
the package as the dependency before using `yum-config-manager`.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-10-05 15:11:02 -06:00
dependabot[bot]
1801ae7870 build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-02 14:56:28 -06:00
Wen Liang
94254894de test(infiniband): Negate the error message in assertion
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-09-25 14:40:16 -06:00
Wen Liang
b97c9bd01e test: Use variable to hold infiniband interface name
To avoid hard coded interface name used all over the place in
`tests_infiniband.yml`, specify a variable to hold the infiniband
interface name instead.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-09-25 14:40:16 -06:00
Sergei Petrosian
7b815366a0
docs(changelog): version 1.13.2 [citest skip] (#634)
Update changelog and .README.html for version 1.13.2

Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2023-09-08 15:15:19 +02:00
Wen Liang
2b8fbe971f docs: Update README.md
Updating README.md to reflect some recently added changes or features.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-09-06 14:48:19 -06:00
Sergei Petrosian
44e5983185
ci: Remove badges from README.md prior to converting to HTML (#633)
- Remove thematic break after badges
- Remove badges from README.md prior to converting to HTML

Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2023-08-28 12:16:58 +02:00
Sergei Petrosian
cd7eafe009
ci: Make badges consistent, run markdownlint all .md files (#631)
- Consistently generate badges for GH workflows in README RHELPLAN-146921
- Run markdownlint on all .md files
- Add custom-woke-action if not used already
- Use woke from linux-system-roles/lsr-woke-action

Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2023-08-24 08:19:05 +02:00
Sergei Petrosian
4dd282e0c5 ci: Add markdownlint, test_html_build, and build_docs workflows
- markdownlint runs against README.md to avoid any issues with
  converting it to HTML
- test_converting_readme converts README.md > HTML and uploads this test
  artifact to ensure that conversion works fine
- build_docs converts README.md > HTML and pushes the result to the
  docs branch to publish dosc to GitHub pages site.
- Fix markdown issues in README.md

Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2023-08-14 08:51:31 -06:00
Rich Megginson
666f9cb333 docs(changelog): version 1.13.1 [citest skip]
Create changelog update and release for version 1.13.1

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-07-20 13:33:40 -06:00
Rich Megginson
751c3fffca fix: facts being gathered unnecessarily
Cause: The comparison of the present facts with the required facts is
being done on unsorted lists.

Consequence: The comparison may fail if the only difference is the
order.  Facts are gathered unnecessarily.

Fix: Use `difference` which works no matter what the order is.  Ensure
that the fact gathering subsets used are the absolute minimum required.

Result: The role gathers only the facts it requires, and does
not unnecessarily gather facts.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-07-14 15:23:56 -06:00
Rich Megginson
a83b157591 ci: ansible-test ignores file for ansible-core 2.15
Need a new ignores file for ansible-core 2.15 ansible-test

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-07-13 10:35:55 -06:00
Rich Megginson
e16b0e65ff ci: ansible-lint - ignore var-naming[no-role-prefix]
ansible-lint has recently added a check for this.  It flags a lot of our test
code, and some of our role code that uses nested roles.
There is no easy way to disable it for these cases only.  It would be a
tremendous amount of work to add `# noqa` comments everywhere.
The use of `.ansible-lint-ignore` would be a maintenance burden (cannot use
tests/tests_*.yml or other similar wildcard to match all test files), would
still issue a lot of warning messages, and would not solve all of the problems.
The only way for now is to skip this rule.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-07-13 09:36:55 -06:00
Rich Megginson
104638e765 docs(changelog): version 1.13.0 [citest skip]
Create changelog update and release for version 1.13.0

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-07-10 10:50:23 -06:00
Wen Liang
835872e681 feat: Support "no-aaaa" DNS option
reason: The administrator wants to suppress the AAAA queries made by
the stub resolver, including AAAA lookups triggered by NSS-based
interfaces such as getaddrinfo. Only the DNS lookups are affected.

result: The administrator is able to suppress AAAA queries made by the
stub resolver.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-06-29 13:10:20 +02:00
Rich Megginson
4371036f14 ci: fix python 2.7 CI tests by manually installing python2.7 package
We use the setup-python github action.  This has dropped support for
python 2.7.  Instead, just manually install the python2.7 package.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-06-28 16:04:06 -06:00
Sergei Petrosian
e791fb9440 ci: Rename commitlint to PR title Lint, echo PR titles from env var
Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2023-06-22 07:42:01 +02:00
Sergei Petrosian
f07e275282 ci: Add pull request template and run commitlint on PR title only
We now ensure the conventional commits format only on PR titles and not on
commits to let developers keep commit messages targeted for other developers
i.e. describe actual changes to code that users should not care about.
And PR titles, on the contrary, must be aimed at end users.

For more info, see
https://linux-system-roles.github.io/contribute.html#write-a-good-pr-title-and-description

Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2023-06-13 11:23:21 -06:00
Rich Megginson
391617cc5c ci: Use tox-lsr 2.13 for py26
tox-lsr 3.x does not support python 2.6, so use tox-lsr 2.13 for
py26 testing.  This should be fine until we can drop support for
python 2.6

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-06-05 12:40:29 -06:00
Ole Pannbacker
c2f89a78b9 feat: add AlmaLinux to RHEL compat distro list
Signed-off-by: Ole Pannbacker <opannbacker@cronon.net>
2023-06-01 16:23:16 -06:00
Rich Megginson
4b7663ce7e docs(changelog): version 1.12.0 [citest skip]
Create changelog update and release for version 1.12.0

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-05-30 13:34:16 -06:00
Wen Liang
ffe01a5f8b feat: Support ipv4_ignore_auto_dns and ipv6_ignore_auto_dns settings
reason: The user wants to ignore automatically configured name servers and
search domains (e.g. dns record from DHCP), and only use the name
servers and search domains specified in the `dns` and `dns_search`
properties.

result: The user is able to ignore automatically configured name servers
and search domains.

Notice that there are two settings here distinguished by the address
families, which aims to be compatible with NetworkManager
(`ipv4.ignore-auto-dns` and `ipv6.ignore-auto-dns`)and Nmstate (setting
`auto-dns` on `ipv4` or `ipv6` section). Also, the users can get auto
DNS from DHCPv4, DHCPv6, modem etc, and they may want to ignore auto
DNS on Ipv4 but not on IPv6, in this case, it is better to have two
settings distinguished by the address families.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-05-29 12:56:41 +02:00
Rich Megginson
2ce6f3afa7 ci: update tox-lsr to version 3.0.0
The major version bump is because tox-lsr 3 drops support
for tox version 2.  If you are using tox 2 you will need to
upgrade to tox 3 or 4.

tox-lsr 3.0.0 adds support for tox 4, commitlint, and ansible-lint-collection

See https://github.com/linux-system-roles/tox-lsr/releases/tag/3.0.0
for full release notes

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-05-17 10:17:19 -06:00
Rich Megginson
fd92063502 docs: Consistent contributing.md for all roles - allow role specific contributing.md section
Provide a single, consistent contributing.md for all roles.  This mostly links to
and summarizes https://linux-system-roles.github.io/contribute.html

Allow for a role specific section which typically has information about
role particulars, role debugging tips, etc.

Fix several markdown consistency issues, other issues found by markdownlint
Use https://www.markdownguide.org/basic-syntax#alternate-syntax style for
headings, using `### heading3`, `#### heading4`, etc. for lower level
headings.

See https://github.com/linux-system-roles/.github/pull/19

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-05-10 14:23:20 -06:00
Rich Megginson
abc370a2e0 docs(changelog): version 1.11.4 [citest skip]
Create changelog update and release for version 1.11.4

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-04-28 13:22:37 -06:00
Rich Megginson
c144794faa style: ansible-lint - remove line-length files from .yamllint.yml
Rather than having to maintain .yamllint.yml with a list of files
exempt from yamllint line-length checking, either fix the code
to abide by the line length restriction, or put the yamllint
exceptions in-line in the code.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-04-28 09:41:30 -06:00
Rich Megginson
211412d035 style: ansible-lint - fix missing YAML document start
ansible-lint requires that YAML documents begin with a line
consisting of `---`

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-04-28 09:15:50 -06:00
Rich Megginson
c0a626ddbb style: Use standard Ansible braces and brackets spacing
Use standard Ansible spacing for braces and brackets.  This
allows us to remove those rule exceptions from .yamllint.yml

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-04-28 09:13:55 -06:00
Sergei Petrosian
7884537284 ci: Add commitlint GitHub action to ensure conventional commits with feedback
For more information, see Conventional Commits format in Contribute
https://linux-system-roles.github.io/contribute.html#conventional-commits-format

Signed-off-by: Sergei Petrosian <spetrosi@redhat.com>
2023-04-28 14:36:36 +02:00
Wen Liang
b02e58db76 Fix the failure of running ANSIBLE_GATHERING=explicit on tests_switch_provider.yml
The test `tests_switch_provider.yml` fails to run with
`ANSIBLE_GATHERING=explicit` with the error described below. Therefore,
include the task 'el_repo_setup.yml' before running the test which
supports gathering the minimum subset of facts required.

```
TASK [set fact to use initscripts network_provider]
task path: /tmp/tmp.Q6nP8W4iPS/rhel_system_roles/tests/network/playbooks/tests_switch_provider.yml:8
fatal: [/tmp/tmp.Q6nP8W4iPS/RHEL_8_8_TESTING.qcow2]: FAILED! => {}
MSG:
The conditional check 'ansible_distribution in ['CentOS', 'RedHat'] and
ansible_distribution_major_version in ['7', '8']' failed. The error
was: error while evaluating conditional (ansible_distribution in
['CentOS', 'RedHat'] and ansible_distribution_major_version in
['7', '8']): 'ansible_distribution' is undefined.
```

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-04-27 15:14:49 -06:00
Rich Megginson
ee2a8eb177 docs(changelog): version 1.11.3 [citest skip]
Create changelog update and release for version 1.11.3

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2023-04-14 09:01:34 -06:00
Wen Liang
46f827419e ansible-lint: Remove the rule 'load-failure' from 'warn_list'
The rule 'load-failure' is unskippable, you cannot use it in
'skip_list' or 'warn_list'.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-04-10 17:49:07 +02:00
Wen Liang
af76d08550 ansible-lint: Enable the check on 'tests/' directory
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-04-10 17:49:07 +02:00
Wen Liang
5ff1189409 ansible-lint: Fix name[missing] and name[play] failures
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2023-04-10 17:49:07 +02:00