1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/plugins/modules
Chih-Hsuan Yen 6ff594b524
nmcli: avoid changed status for most cases with VPN connections (#5126)
* nmcli: avoid changed status for most cases with VPN connections

Follow-up https://github.com/ansible-collections/community.general/pull/4746

* `nmcli connection show` includes vpn.service-type but not vpn-type.
  Switching to vpn.service-type removes unneeded diffs while keeping
  the same functionality, as vpn-type is an alias of vpn.service-type
  per nm-settings-nmcli(1).

  NetworkManager also adds `org.freedesktop.NetworkManager.` prefix for
  known VPN types [1]. The logic is non-trivial so I didn't implement it
  in this commit. If a user specifies `service-type: l2tp`, changed will
  be always be True:

    -    "vpn.service-type": "org.freedesktop.NetworkManager.l2tp"
    +    "vpn.service-type": "l2tp"

* The vpn.data field from `nmcli connection show` is sorted by keys and
  there are spaces around equal signs. I added codes for parsing such
  data.

Tests are also updated to match outputs of nmcli commands.

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/1.38.4/src/libnm-core-impl/nm-vpn-plugin-info.c#L619

* Add changelog

* Some suggested changes

* Make space stripping more flexible - works for cases without equal
  signs.
* Keep vpn.data in a test case with no spaces

* nmcli: allow any string for vpn service-type
2022-09-03 12:02:03 +02:00
..
cloud Fix exception when agent argument is not specified. (#5194) 2022-08-28 12:03:27 +02:00
clustering Adjust booleans in net tools, web infrastructure, and clustering modules. (#5159) 2022-08-24 20:00:11 +02:00
database Adjust booleans in misc modules. (#5160) 2022-08-24 20:00:26 +02:00
files Adjust booleans in misc modules. (#5160) 2022-08-24 20:00:26 +02:00
identity Adjust booleans in misc modules. (#5160) 2022-08-24 20:00:26 +02:00
monitoring Adjust booleans in monitoring modules. (#5156) 2022-08-24 19:59:30 +02:00
net_tools nmcli: avoid changed status for most cases with VPN connections (#5126) 2022-09-03 12:02:03 +02:00
notification Adjust booleans in notification modules. (#5157) 2022-08-24 19:59:46 +02:00
packaging New module: pipx_info (#5196) 2022-09-03 12:00:04 +02:00
remote_management Update redfish module for compatibility with VirtualMedia resource location (#5124) 2022-08-24 21:36:35 +02:00
source_control Adjust booleans in source control modules. (#5158) 2022-08-24 19:59:56 +02:00
storage Adjust booleans in misc modules. (#5160) 2022-08-24 20:00:26 +02:00
system seport: add local argument (#5203) 2022-09-03 11:53:57 +02:00
web_infrastructure Adjust booleans in net tools, web infrastructure, and clustering modules. (#5159) 2022-08-24 20:00:11 +02:00