diff --git a/salt/states/hostapd/init.sls b/salt/states/hostapd/init.sls index 80f7d00..ae64f9a 100644 --- a/salt/states/hostapd/init.sls +++ b/salt/states/hostapd/init.sls @@ -3,6 +3,13 @@ Set {{ pillar['network']['wireless'] }} to not be managed by NetworkManager: - 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" +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: cmd.run: - name: nmcli connection delete {{ pillar['network']['interface'] }}