For those interested, here's an Ansible playbook to add the MANA driver to the modprobe deny-list. This assumes you have an Ansible inventory group for your CloudGuard management and CloudGuard gateway hosts. You also need a user that can login via SSH directly into Expert mode. This playbook does not use Gaia API.
---
# disable_mana.yml
# Add the Microsoft MANA driver to modprobe deny-list
# sk183754
#
- name: Disable Microsoft MANA driver
hosts: ckp_mgmt_azure,ckp_gw_azure # Inventory group of Azure hosts
gather_facts: false
become: false
remote_user: YOUR_EXPERT_MODE_USER
vars:
output_dir: /tmp/disable_microsoft_mana # Change to your own output path
tasks:
- name: Create output directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
recurse: true
loop:
- "{{ output_dir }}/{{ inventory_hostname }}/BEFORE"
- "{{ output_dir }}/{{ inventory_hostname }}/AFTER"
delegate_to: localhost
# ITSM Change Control BEFORE state
- block:
- name: Get current modprobe config
ansible.builtin.fetch:
src: /etc/modprobe.d/disable_mana.conf
dest: "{{ output_dir }}/{{ inventory_hostname }}/BEFORE/disable_mana.conf"
flat: true
register: fetch_result
rescue:
- name: modprobe config absent
ansible.builtin.copy:
content: "disable_mana.conf does not exist"
dest: "{{ output_dir }}/{{ inventory_hostname }}/BEFORE/disable_mana.conf.txt"
delegate_to: localhost
- name: Add MANA to modprobe config
ansible.builtin.copy:
content: "blacklist mana\n"
dest: /etc/modprobe.d/disable_mana.conf
owner: root
group: root
mode: '0644'
# ITSM Change Control AFTER state
- block:
- name: Get current modprobe config
ansible.builtin.fetch:
src: /etc/modprobe.d/disable_mana.conf
dest: "{{ output_dir }}/{{ inventory_hostname }}/AFTER/disable_mana.conf"
flat: true
rescue:
- name: modprobe config absent
ansible.builtin.copy:
content: "disable_mana.conf does not exist"
dest: "{{ output_dir }}/{{ inventory_hostname }}/AFTER/disable_mana.conf.txt"
delegate_to: localhost
...
Your inventory would look like this:
---
# inventory.yml
all:
children:
ckp_mgmt_azure:
hosts:
mgmt01:
ansible_host: 192.0.2.1
ckp_gw_azure:
hosts:
gw01:
ansible_host: 192.0.2.2
gw02:
ansible_host: 192.0.2.3
...
Run the playbook:
ansible-playbook -i inventory.yml disable_mana.yml -k # "-k" asks for the expert-level user password
The playbook will capture the BEFORE/AFTER state of the configuration for your ITSM/Change Control management. There is no TEST plan, however, since this is just modifying the file. This doesn't automatically reboot the host. If you want to do that, you can add a ansible.builtin.reboot module task at the end.