From dea2928d3a1038ce04941f06b3b2d9a55a28b024 Mon Sep 17 00:00:00 2001 From: jonas Date: Mon, 18 Oct 2021 09:42:29 +0200 Subject: [PATCH] . --- salt/states/hostapd/init.sls | 7 +++++++ 1 file changed, 7 insertions(+) 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'] }}