Commit graph

94 commits

Author SHA1 Message Date
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
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
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
Noriko Hosoi
4ac93457b3 Non-inclusive words - Fix wokeignore comment in README.md
To allow a "non-inclusive word" in README.md, a wokeignore rule
was added as follows.
```
   <!--- wokeignore:rule=word -->
   "non-inclusive word" in kernel and NetworkManager.
```
When the markdown format is converged to the html format,
the comment line is treated as a blank line proceeded by `<p>`.
```
   <p><!--- wokeignore:rule=word --><br />
   "non-inclusive word" in kernel and NetworkManager.
```
Starting with `<p>` and being followed by`<br />`, the
wokeignore rule loses the ability to make the inclusive language
utility `woke` skip checking the non-inclusive word in the next
line.

Instead of putting the wokeignore rule comment above the non-
inclusive word, it's placed in the same line.

Signed-off-by: Noriko Hosoi <nhosoi@redhat.com>
2023-02-09 14:23:43 +01:00
Bernd Müller
1a5338f452 fix the ansible-pull link, the old do not work
Signed-off-by: Bernd Müller <bernd.mueller@sup-logistik.de>
2023-01-19 15:14:32 -07:00
Noriko Hosoi
f3078c256e Clean up / Workaround non-inclusive words
- CHANGELOG.md
- README.md
- contributing.md
- library/network_connections.py
- module_utils/network_lsr/argument_validator.py
- module_utils/network_lsr/ethtool.py
- tests/ensure_provider_tests.py
- tests/playbooks/tests_bond_options.yml
- tests/unit/test_network_connections.py

Signed-off-by: Noriko Hosoi <nhosoi@redhat.com>
2023-01-19 15:13:35 -07:00
Sylvain
79d1fa2739 Support cloned MAC address
The users want to create the bonding interface with the MAC address
specified by themselves or specify the strategy (e.g. random, preserve)
to get the default MAC for the bonding interface. Thus, add support for
the cloned MAC address.

Signed-off-by: Sylvain <35niavlys@gmail.com>
2022-12-12 08:11:23 -07: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
Wen Liang
3d10af067a Support the DNS priority
The users want to configure the priority of DNS servers, add support for
that.

Fixes https://github.com/linux-system-roles/network/issues/505.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2022-11-01 11:55:11 -06:00
Wen Liang
c913aa0b93 Support 'route_metric4' for initscripts provider
The user want to change the metric for the default route, add support
for that.

https://bugzilla.redhat.com/show_bug.cgi?id=2134201

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2022-10-21 15:22:11 +02:00
Wen Liang
cfbd14cd8a Support looking up named route table in routing rule
The user may need to define the named route table in the routing rule
besides the table id, add support for that.

The commit fixes
https://github.com/linux-system-roles/network/issues/506.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2022-09-30 16:26:48 +02:00
Wen Liang
e694ad72c1 Support the nmstate network state configuration
The users want to apply the nmstate network state configuration to the
interface directly through the role, which necessitates the less
complexity of the network configuration and allows the partial
configuration on the network.

To warrant that the users are capable to apply the nmstate network state
configuration, add the support for the `network_state` variable.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2022-07-01 12:29:38 +02:00
Wen Liang
84222cb610 infiniband: Add the setting description
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2022-05-19 12:41:35 +02:00
Wen Liang
6da2df4ba0 Add support for routing rules
In order to enable the user using the policy routing (e.g. source
routing) or instructing the system which table to look up to determine
the correct route, add support for routing rules.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2022-04-21 12:19:26 +02:00
Wen Liang
8b8492eac6 Bond: Clarify and tests the order of destroying bond
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2022-03-23 11:40:06 +01:00
Till Maas
ce979cdb18 README: Remove outdated information regarding the ifcfg-rh plugin.
The storage plugin used by NM is an implementation detail that the role
does not care about, since it uses NM via libnm.

Signed-off-by: Till Maas <opensource@till.name>
2022-03-21 14:06:20 +01:00
Wen Liang
59be618857 Support more bond options
In order to enable user to flexibly control the network transmission
over the bonded interface, support all the bond options which are
currently supported by NetworkManager.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2022-02-11 23:40:34 +01:00
Till Maas
9d8a280b8a README: Clarify the name setting
Signed-off-by: Till Maas <opensource@till.name>
2022-02-04 18:14:52 +01:00
Wen Liang
5eb03fa992 Support routing tables in static routes
The users want to use the policy routing (e.g. source routing), so
that they can forward the packet based on the other criteria except for
the destination address in the packet. In such scenario, the routing
tables have to be supported beforehand in static routes, so that the
users can define policy routing rules later to instruct the system
which table to use to determine the correct route.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2022-01-27 18:18:47 +01:00
Wen Liang
9fd19afa25 Allow configuring network connection via matching path
Users can easily configure or update network connection via matching
physical device path of the interface, which add certain flexibilty of
user experience.

Update connection profile via matching `path` setting:

```yaml
  - name: eth0
    type: ethernet
    autoconnect: yes
    # For PCI devices, the path has the form "pci-$domain:$bus:$device.$function"
    # It will only update the interface with the path "pci-0000:00:03.0"
    match:
      path:
        - pci-0000:00:03.0
```

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2021-10-06 18:22:42 +08:00
Brian Smith
46ff0ece04 Update README.md to note that network teaming is deprecated in RHEL 9.
Signed-off-by: Brian Smith <briasmit@redhat.com>
2021-10-04 22:58:50 -04:00
Wen Liang
a2af42d0f2 wifi: Add Simultaneous Authentication of Equals(SAE) support
Enable WPA3 SAE support via:

    ```yaml
    network_connections:
      - name: wlan0
        type: wireless
        wireless:
          ssid: "WIFI_SSID"
          key_mgmt: "sae"
	  password: "p@55w0rD"
    ```

Integration test case was included for Fedora and CentOS. ( Failed in setting up the
mock wifi on RHEL, so skipped the integration test on RHEL)

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2021-08-09 09:59:22 +08:00
Jack Adolph
b368bce8aa Add 'auto_gateway' option
If enabled, a default route will be configured using the default gateway. If disabled,
the default route will be removed.

If this variable is not specified, the role will use the default behavior of the
`network_provider` selected.

Setting this option to `no` is equivalent to:
- `DEFROUTE = no` in initscripts, or
- `ipv4.never-default/ipv6.never-default yes` in nmcli

Signed-off-by: Jack Adolph <jack.adolph@gmail.com>
2021-06-04 07:07:13 +08:00
Wen Liang
93e509b533 Fix: support dns_search and dns_options for all address family
`dns_search` and `dns_options` should not be specific to the address
family. Previously, `dns_search` and `dns_options` were only supported
for IPv4 nameservers, so we also need to support `dns_search` and
`dns_options` for IPv6 nameservers.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2021-05-24 15:34:52 +08:00
Wen Liang
2444e27cce wifi: Add Opportunistic Wireless Encryption (OWE) support
Enable WPA3 OWE support via:

    ```yaml
    network_connections:
      - name: wlan0
        type: wireless
        wireless:
          ssid: "WIFI_SSID"
          key_mgmt: "owe"
    ```

Integration test case was included for Fedora and CentOS. ( Failed in setting up the
mock wifi on RHEL, so skipped the integration test on RHEL)

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2021-05-24 10:51:01 +08:00
Wen Liang
ae2d60a0b2 Add support for ETHTOOL Ring option
ETHTOOL Ring option is not supported by NetworkManager until
NM 1.25.2. Currently, ETHTOOL Ring option is not suppored by
Network role, so enable the support for ETHTOOL Ring option.

Configure ethtool ring option via:

	```yaml
            network_connections:
              - name: testnic1
                type: ethernet
                state: up
                ip:
                  dhcp4: no
                  auto6: no
                ethtool:
                  ring:
                    rx: 128
                    rx_jumbo: 128
                    rx_mini: 128
                    tx: 128
	```

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2021-05-11 18:19:16 +02:00
Wen Liang
4f62185714 Document gateway4 and gateway6 setting in README.md
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2021-04-15 21:15:54 +02:00
Rich Megginson
f5ff30a66c fix most ansible-test issues, suppress the rest
Automation Hub, and possibly Galaxy in the future, require the
collection to be screened with `ansible-test sanity` among other
checks.  The role had a number of issues:
* Use `AssertionError` instead of `assert`
* Use of `logging` module not in accordance with standards, but these
  are ok and the errors were suppressed
* Several import errors which are ok because they are checked
  elsewhere
* __init__.py in the module_utils directories must be empty, so a
  new file myerror.py was added to move the code from __init__.py
  * NOTE: network_lsr/nm/__init__.py is not empty
* The documentation block in the module was not properly constructed
  or formatted.
* shellcheck issues, including removing unused files
* use `unused` instead of `_` (underscore) for variables that are
  unused

add WARNING to module docs - collection users should not use directly

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2021-04-09 19:57:55 +02:00
Wen Liang
387005098b Docs: update 'mac' to suggest user using quotation mark
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2021-04-07 21:03:58 +02:00
Till Maas
ffa98f4876 Unify Markdown syntax
- Use a consistent style for lists and fix indentations
- Adjust whitespace to fence lists or code blocks
- Remove double blank lines
- Wrap lines at 88 characters
- Add missing notations for code
- Use proper links instead of plain URLs
- Reword some parts to fit the style and update the text

Signed-off-by: Till Maas <opensource@till.name>
2021-04-07 18:06:31 +02:00
Wen Liang
cffefa8736 Docs: list all the available dns options for ipv4
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2021-04-02 15:47:46 +08:00
Fernando Fernandez Mancera
f4fabea554 README: remove "slaves" leftover from documentation
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2021-02-23 00:03:18 +01:00
Wen Liang
8318686620 Support ipv6.method disabled in network role
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2021-02-19 18:12:52 +01:00
Fernando Fernandez Mancera
3167b3c125 inclusive language: use "port" instead of "slave"
In order to promote a diverse and inclusive environment we are replacing
all the reference to "slave" for "port".

Test case added.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2021-02-03 15:15:04 +01:00
Fernando Fernandez Mancera
a283e47c12 inclusive language: use "controller" instead of "master"
In order to promote a diverse and inclusive environment we are replacing
all the reference to "master" for "controller".

Test case added.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2021-02-03 12:57:03 +01:00
Wen Liang
880b7ab0cc Support dns-options in network role
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2021-01-28 09:57:45 +08:00
Antonio Cardace
69ae6b5b2a readme: Update README with ethtool coalescing options
Resolves: #112
Signed-off-by: Antonio Cardace <acardace@redhat.com>
2021-01-09 11:02:07 +08:00
Rich Megginson
c64b3b15ba use github actions instead of travis
adds a github actions tox workflow for CI testing, since
travis is discontinuing support for open source projects

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
2020-12-11 14:46:40 +08:00
Fernando Fernandez Mancera
6812aab616 README.md: replace reference to "master" branch with "main" branch
All links containing references to the "master" branch must be replaced
by the "main" branch.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2020-11-10 10:36:22 +01:00
Till Maas
0b2edc50d8 Forget unmanaged state in NetworkManager
When removing a profile with initscripts, also notify NetworkManager so
it can forget that the specified device was to be ignored.
2020-07-11 16:17:06 +02:00
Till Maas
8deab236f0 README: Clarify order of dependent profiles 2020-07-09 22:40:58 +02:00
Jack Adolph
51f8e5b05f Add support for wireless connections
WPA-PSK and WPA-EAP are supported. Uses existing 802.1x features of the role.
Added extra functionality to ArgValidatorStr to enforce a min and max length.
2020-06-15 21:10:54 +02:00
Jack Adolph
dd4ae77cbf Add ca_path option for 802.1x connections
Special notes:
Hash the cacert in the ca_path as OpenSSL needs symlinks for ca
certificates from their symlinks to their filename if specifying a
directory.

In case ieee802_1x.ca_path is specified but not supported by
NetworkManager, fail to ensure the setting is not silently ignored.

References:
https://stackoverflow.com/questions/25889341/what-is-the-equivalent-of-unix-c-rehash-command-script-on-linux
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/448

Co-authored-by: Till Maas <opensource@till.name>
2020-06-15 18:26:34 +02:00
Elvira Garcia Ruiz
ef20874f4d library: Change ethtool features to use underscores
Ethtool features should use underscores instead of dashes. A
warning shows in case dashes used, and it fails if underscore and dashes are
mixed. Unit tests and integration tests have been added. Since nm already
needed underscores, the string processing that was made in nm_provider is now
unneeded and therefore removed.
2020-06-15 14:13:23 +02:00
Elvira Garcia Ruiz
c9d2f8f3b7 Update contributing.md with detailed info of the project
Now the contribution document has some steps to facilitate to get into the
project's workflow for new contributors. It also contains the code
structure and how to use the CI testing of the project and basic info about git
configuration. A small reference to the contributing document has been added to
the readme.

Signed-off-by: Elvira Garcia Ruiz <elviragr@riseup.net>
2020-05-27 13:59:49 +02:00
Patrick Ladd
52ca060167 Document setting bond options
There was no documentation of the supported bond options.
Added supported options to the README.md and added an example of a
simple bond with both of those options.
2020-05-11 17:14:46 +02:00
Jack Adolph
939772fdc1 Add support for domain-suffix-match 802.1x option
Role now supports validating the domain name of the EAP server certificate.
Regenerated the CA certificate as the private key for the original CA has been lost.
Updated test certificates to include a domain name in the CN so the domain-suffix-match
feature can be tested.
2020-05-04 13:01:41 +02:00
Jack Adolph
330729c6dd Change 802.1x parameters to be valid python identifiers 2020-04-21 08:11:15 +02:00
a-mere-peasant
11a03f0ceb Add documentation for existing team type support
Add no other configurability available
2020-04-06 15:23:58 +02:00