�
�Udac @` s! d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
Z
d d l m Z d d
l
m Z d d l j j Z d d l m Z y d d l Z e Z Wn e k
r� e Z n Xd d l Z e j � Z d e f d � � YZ d � Z e d k re � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust certifiedt supported_bys
module: na_ontap_firewall_policy
short_description: NetApp ONTAP Manage a firewall policy
version_added: '2.7'
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Configure firewall on an ONTAP node and manage firewall policy for an ONTAP SVM
extends_documentation_fragment:
- netapp.na_ontap
requirements:
- Python package ipaddress. Install using 'pip install ipaddress'
options:
state:
description:
- Whether to set up a firewall policy or not
choices: ['present', 'absent']
default: present
allow_list:
description:
- A list of IPs and masks to use.
- The host bits of the IP addresses used in this list must be set to 0.
policy:
description:
- A policy name for the firewall policy
service:
description:
- The service to apply the policy to
choices: ['dns', 'http', 'https', 'ndmp', 'ndmps', 'ntp', 'rsh', 'snmp', 'ssh', 'telnet']
vserver:
description:
- The Vserver to apply the policy to.
enable:
description:
- enable firewall on a node
choices: ['enable', 'disable']
logging:
description:
- enable logging for firewall on a node
choices: ['enable', 'disable']
node:
description:
- The node to run the firewall configuration on
s�
- name: create firewall Policy
na_ontap_firewall_policy:
state: present
allow_list: [1.2.3.0/24,1.3.0.0/16]
policy: pizza
service: http
vserver: ci_dev
hostname: "{{ netapp hostname }}"
username: "{{ netapp username }}"
password: "{{ netapp password }}"
- name: Modify firewall Policy
na_ontap_firewall_policy:
state: present
allow_list: [1.5.3.0/24]
policy: pizza
service: http
vserver: ci_dev
hostname: "{{ netapp hostname }}"
username: "{{ netapp username }}"
password: "{{ netapp password }}"
- name: Destroy firewall Policy
na_ontap_firewall_policy:
state: absent
policy: pizza
service: http
vserver: ci_dev
hostname: "{{ netapp hostname }}"
username: "{{ netapp username }}"
password: "{{ netapp password }}"
- name: Enable firewall and logging on a node
na_ontap_firewall_policy:
node: test-vsim1
enable: enable
logging: enable
hostname: "{{ netapp hostname }}"
username: "{{ netapp username }}"
password: "{{ netapp password }}"
t
N( t
AnsibleModule( t to_native( t NetAppModulet NetAppONTAPFirewallPolicyc B` sw e Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z
e d � Z d
� Z
d � Z RS( c C` s� t j � | _ | j j t d t d t d d d g d d � d t d t d d � d
t d t d d � d t d t d d d d
d d d d d d d d d g
� d t d t d d � d t d t d d d d d g � d t d t d d d d d g � d t d t d d � � � t d | j d d
d d g d d g f d t � | _ t � | _
| j
j | j j � | _
t t k r�| j j d d � n t j d! | j � | _ t t k r�| j j d d"