Skip to content

Commit

Permalink
Merge pull request #10018 from mildas/wireless_disable_install_networ…
Browse files Browse the repository at this point in the history
…kmanager

Install NetworkManager as part of `wireless_disable_interfaces` remediation
  • Loading branch information
marcusburghardt authored Jan 3, 2023
2 parents af29431 + 94f0113 commit 5c0e874
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
# complexity = low
# disruption = medium

- name: Check if NetworkManager is installed
ansible.builtin.package_facts:
manager: "auto"

- name: Error message when NetworkManager not installed
fail:
msg: "NetworkManager package not installed"
when: "'NetworkManager' not in ansible_facts.packages"
- name: Ensure NetworkManager is installed
ansible.builtin.package:
name: "{{ item }}"
state: present
with_items:
- NetworkManager

- name: Deactivate Wireless Network Interfaces
command: nmcli radio wifi off
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# platform = multi_platform_all

if
rpm -q NetworkManager
then
nmcli radio all off
else
echo "NetworkManager package not installed" >&2
fi
{{{ bash_package_install("NetworkManager") }}}

nmcli radio all off

0 comments on commit 5c0e874

Please sign in to comment.