This commit is contained in:
jonas 2021-10-18 09:42:29 +02:00
parent 7f0b81f7ac
commit dea2928d3a

View File

@ -3,6 +3,13 @@ Set {{ pillar['network']['wireless'] }} to not be managed by NetworkManager:
- name: nmcli device set {{ pillar['network']['wireless'] }} managed no - name: nmcli device set {{ pillar['network']['wireless'] }} managed no
- unless: bash -c "if [[ \"$(nmcli device show {{ pillar['network']['wireless'] }} | sed -n 's/^GENERAL.STATE.*(\(.*\)).*$/\1/p')\" == \"unmanaged\" ]]; then exit 0; else exit 1; fi" - unless: bash -c "if [[ \"$(nmcli device show {{ pillar['network']['wireless'] }} | sed -n 's/^GENERAL.STATE.*(\(.*\)).*$/\1/p')\" == \"unmanaged\" ]]; then exit 0; else exit 1; fi"
Configure keyfile block in NetworkManager.conf:
file.append:
- name: /etc/NetworkManager/NetworkManager.conf
- text: |
[keyfile]
unmanaged-devices=interface-name:{{ pillar['network']['wireless'] }}
Delete {{ pillar['network']['interface'] }} connection: Delete {{ pillar['network']['interface'] }} connection:
cmd.run: cmd.run:
- name: nmcli connection delete {{ pillar['network']['interface'] }} - name: nmcli connection delete {{ pillar['network']['interface'] }}