ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
833 stars 1.53k forks source link

[PR #8897/d4fb6bf8 backport][stable-9] nmcli: conn_reload param and up/down states #8975

Closed patchback[bot] closed 1 month ago

patchback[bot] commented 1 month ago

This is a backport of PR #8897 as merged into main (d4fb6bf8a65afabe3576b49af906585425571ac3).

SUMMARY

Add conn_reload option to perform nmcli connection reload if set to true Add up and down states to perform nmcli up/nmcli down commands

Fixes #3752 Fixes #8704 Fixes #7152

ISSUE TYPE
COMPONENT NAME

nmcli

ADDITIONAL INFORMATION

I am not completely sure how to make applying changes correctly as there is no distinct difference between 4 different variants in a related issue (see https://github.com/ansible-collections/community.general/issues/3752#issuecomment-1714459183) so if you have some ideas I would be glad to get comments from you :)

# Changing with reloading afterwards
  - name: Change the property of a setting e.g. MTU and reload connection
    community.general.nmcli:
      conn_name: my-eth1
      mtu: 1500
      type: ethernet
      state: present
      conn_reload: true

# Simply disabling connection
  - name: Disable connection
    community.general.nmcli:
      conn_name: my-eth1
      state: down

# Reload and then enable connection
  - name: Reload and enable connection
    community.general.nmcli:
      conn_name: my-eth1
      state: up
      reload: true
ansibullbot commented 1 month ago

cc @alcamie101 click here for bot help