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/net_tools
patchback[bot] 1cddae2265
nmcli: avoid changed status for most cases with VPN connections (#5126) (#5220)
* 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

(cherry picked from commit 6ff594b524)

Co-authored-by: Chih-Hsuan Yen <yan12125@gmail.com>
2022-09-03 12:15:38 +02:00
..
infinity Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt (#5065) (#5068) 2022-08-05 13:17:19 +02:00
ldap Adjust booleans in net tools, web infrastructure, and clustering modules. (#5159) (#5173) 2022-08-24 20:22:02 +02:00
pritunl Adjust booleans in net tools, web infrastructure, and clustering modules. (#5159) (#5173) 2022-08-24 20:22:02 +02:00
cloudflare_dns.py Adjust booleans in net tools, web infrastructure, and clustering modules. (#5159) (#5173) 2022-08-24 20:22:02 +02:00
dnsimple.py Adjust booleans in net tools, web infrastructure, and clustering modules. (#5159) (#5173) 2022-08-24 20:22:02 +02:00
dnsimple_info.py Fix linting errors; fix some real bugs (#5111) (#5114) 2022-08-12 12:33:02 +02:00
dnsmadeeasy.py Adjust booleans in net tools, web infrastructure, and clustering modules. (#5159) (#5173) 2022-08-24 20:22:02 +02:00
gandi_livedns.py Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt (#5065) (#5068) 2022-08-05 13:17:19 +02:00
haproxy.py Adjust booleans in net tools, web infrastructure, and clustering modules. (#5159) (#5173) 2022-08-24 20:22:02 +02:00
ip_netns.py Add more license statements (#5079) (#5088) 2022-08-07 12:03:49 +00:00
ipify_facts.py Adjust booleans in net tools, web infrastructure, and clustering modules. (#5159) (#5173) 2022-08-24 20:22:02 +02:00
ipinfoio_facts.py Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt (#5065) (#5068) 2022-08-05 13:17:19 +02:00
ipwcli_dns.py Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt (#5065) (#5068) 2022-08-05 13:17:19 +02:00
lldp.py Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt (#5065) (#5068) 2022-08-05 13:17:19 +02:00
netcup_dns.py Fix copyright lines (make sure 'Copyright' is there). (#5083) (#5084) 2022-08-05 22:45:15 +02:00
nmcli.py nmcli: avoid changed status for most cases with VPN connections (#5126) (#5220) 2022-09-03 12:15:38 +02:00
nsupdate.py Fix nsupdate when updating NS record (#5112) (#5132) 2022-08-20 13:34:36 +02:00
omapi_host.py Adjust booleans in net tools, web infrastructure, and clustering modules. (#5159) (#5173) 2022-08-24 20:22:02 +02:00
snmp_facts.py [PR #5098/aab22e7f backport][stable-5] Add remaining copyright statements, add licenses sanity test (#5099) 2022-08-14 10:26:44 +02:00