Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/f5/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyo

�
�Udac@`s3ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddl
mZyddd
l
mZddlmZddlmZddlmZddlmZddlmZWnqek
rIdd
lmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd ��YZd!efd"��YZ d#efd$��YZ!d%�Z"e#d&kr/e"�nd'S((i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys&
---
module: bigip_firewall_rule
short_description: Manage AFM Firewall rules
description:
  - Manages firewall rules in an AFM firewall policy. New rules will always be added to the
    end of the policy. Rules can be re-ordered using the C(bigip_security_policy) module.
    Rules can also be pre-ordered using the C(bigip_security_policy) module and then later
    updated using the C(bigip_firewall_rule) module.
version_added: 2.7
options:
  name:
    description:
      - Specifies the name of the rule.
    type: str
    required: True
  parent_policy:
    description:
      - The policy which contains the rule to be managed.
      - One of either C(parent_policy) or C(parent_rule_list) is required.
    type: str
  parent_rule_list:
    description:
      - The rule list which contains the rule to be managed.
      - One of either C(parent_policy) or C(parent_rule_list) is required.
    type: str
  action:
    description:
      - Specifies the action for the firewall rule.
      - When C(accept), allows packets with the specified source, destination,
        and protocol to pass through the firewall. Packets that match the rule,
        and are accepted, traverse the system as if the firewall is not present.
      - When C(drop), drops packets with the specified source, destination, and
        protocol. Dropping a packet is a silent action with no notification to
        the source or destination systems. Dropping the packet causes the connection
        to be retried until the retry threshold is reached.
      - When C(reject), rejects packets with the specified source, destination,
        and protocol. When a packet is rejected the firewall sends a destination
        unreachable message to the sender.
      - When C(accept-decisively), allows packets with the specified source,
        destination, and protocol to pass through the firewall, and does not require
        any further processing by any of the further firewalls. Packets that match
        the rule, and are accepted, traverse the system as if the firewall is not
        present. If the Rule List is applied to a virtual server, management IP,
        or self IP firewall rule, then Accept Decisively is equivalent to Accept.
      - When creating a new rule, if this parameter is not provided, the default is
        C(reject).
    type: str
    choices:
      - accept
      - drop
      - reject
      - accept-decisively
  status:
    description:
      - Indicates the activity state of the rule or rule list.
      - When C(disabled), specifies that the rule or rule list does not apply at all.
      - When C(enabled), specifies that the system applies the firewall rule or rule
        list to the given context and addresses.
      - When C(scheduled), specifies that the system applies the rule or rule list
        according to the specified schedule.
      - When creating a new rule, if this parameter is not provided, the default
        is C(enabled).
    type: str
    choices:
      - enabled
      - disabled
      - scheduled
  schedule:
    description:
      - Specifies a schedule for the firewall rule.
      - You configure schedules to define days and times when the firewall rule is
        made active.
    type: str
  description:
    description:
      - The rule description.
    type: str
  irule:
    description:
      - Specifies an iRule that is applied to the firewall rule.
      - An iRule can be started when the firewall rule matches traffic.
    type: str
  protocol:
    description:
      - Specifies the protocol to which the rule applies.
      - Protocols may be specified by either their name or numeric value.
      - A special protocol value C(any) can be specified to match any protocol. The
        numeric equivalent of this protocol is C(255).
    type: str
  source:
    description:
      - Specifies packet sources to which the rule applies.
      - Leaving this field blank applies the rule to all addresses and all ports.
      - You can specify the following source items. An IPv4 or IPv6 address, an IPv4
        or IPv6 address range, geographic location, VLAN, address list, port,
        port range, port list or address list.
      - You can specify a mix of different types of items for the source address.
    suboptions:
      address:
        description:
          - Specifies a specific IP address.
        type: str
      address_list:
        description:
          - Specifies an existing address list.
        type: str
      address_range:
        description:
          - Specifies an address range.
        type: str
      country:
        description:
          - Specifies a country code.
        type: str
      port:
        description:
          - Specifies a single numeric port.
          - This option is only valid when C(protocol) is C(tcp)(6) or C(udp)(17).
        type: int
      port_list:
        description:
          - Specifes an existing port list.
          - This option is only valid when C(protocol) is C(tcp)(6) or C(udp)(17).
        type: str
      port_range:
        description:
          - Specifies a range of ports, which is two port values separated by
            a hyphen. The port to the left of the hyphen should be less than the
            port to the right.
          - This option is only valid when C(protocol) is C(tcp)(6) or C(udp)(17).
        type: str
      vlan:
        description:
          - Specifies VLANs to which the rule applies.
          - The VLAN source refers to the packet's source.
        type: str
    type: list
  destination:
    description:
      - Specifies packet destinations to which the rule applies.
      - Leaving this field blank applies the rule to all addresses and all ports.
      - You can specify the following destination items. An IPv4 or IPv6 address,
        an IPv4 or IPv6 address range, geographic location, VLAN, address list, port,
        port range, port list or address list.
      - You can specify a mix of different types of items for the source address.
    suboptions:
      address:
        description:
          - Specifies a specific IP address.
        type: str
      address_list:
        description:
          - Specifies an existing address list.
        type: str
      address_range:
        description:
          - Specifies an address range.
        type: str
      country:
        description:
          - Specifies a country code.
        type: str
      port:
        description:
          - Specifies a single numeric port.
          - This option is only valid when C(protocol) is C(tcp)(6) or C(udp)(17).
        type: int
      port_list:
        description:
          - Specifes an existing port list.
          - This option is only valid when C(protocol) is C(tcp)(6) or C(udp)(17).
        type: str
      port_range:
        description:
          - Specifies a range of ports, which is two port values separated by
            a hyphen. The port to the left of the hyphen should be less than the
            port to the right.
          - This option is only valid when C(protocol) is C(tcp)(6) or C(udp)(17).
        type: str
    type: list
  logging:
    description:
      - Specifies whether logging is enabled or disabled for the firewall rule.
      - When creating a new rule, if this parameter is not specified, the default
        if C(no).
    type: bool
  rule_list:
    description:
      - Specifies an existing rule list to use in the rule.
      - This parameter is mutually exclusive with many of the other individual-rule
        specific settings. This includes C(logging), C(action), C(source),
        C(destination), C(irule'), C(protocol) and C(logging).
      - This parameter is only used when C(parent_policy) is specified, otherwise it is ignored.
    type: str
  icmp_message:
    description:
      - Specifies the Internet Control Message Protocol (ICMP) or ICMPv6 message
        C(type) and C(code) that the rule uses.
      - This parameter is only relevant when C(protocol) is either C(icmp)(1) or
        C(icmpv6)(58).
    suboptions:
      type:
        description:
          - Specifies the type of ICMP message.
          - You can specify control messages, such as Echo Reply (0) and Destination
            Unreachable (3), or you can specify C(any) to indicate that the system
            applies the rule for all ICMP messages.
          - You can also specify an arbitrary ICMP message.
          - The ICMP protocol contains definitions for the existing message type and
            number pairs.
        type: str
      code:
        description:
          - Specifies the code returned in response to the specified ICMP message type.
          - You can specify codes, each set appropriate to the associated type, such
            as No Code (0) (associated with Echo Reply (0)) and Host Unreachable (1)
            (associated with Destination Unreachable (3)), or you can specify C(any)
            to indicate that the system applies the rule for all codes in response to
            that specific ICMP message.
          - You can also specify an arbitrary code.
          - The ICMP protocol contains definitions for the existing message code and
            number pairs.
        type: str
    type: list
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
  state:
    description:
      - When C(state) is C(present), ensures that the rule exists.
      - When C(state) is C(absent), ensures that the rule is removed.
    type: str
    choices:
      - present
      - absent
    default: present
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s?
- name: Create a new rule in the foo firewall policy
  bigip_firewall_rule:
    name: foo
    parent_policy: policy1
    protocol: tcp
    source:
      - address: 1.2.3.4
      - address: "::1"
      - address_list: foo-list1
      - address_range: 1.1.1.1-2.2.2.2
      - vlan: vlan1
      - country: US
      - port: 22
      - port_list: port-list1
      - port_range: 80-443
    destination:
      - address: 1.2.3.4
      - address: "::1"
      - address_list: foo-list1
      - address_range: 1.1.1.1-2.2.2.2
      - country: US
      - port: 22
      - port_list: port-list1
      - port_range: 80-443
    irule: irule1
    action: accept
    logging: yes
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Create an ICMP specific rule
  bigip_firewall_rule:
    name: foo
    protocol: icmp
    icmp_message:
      type: 0
    source:
      - country: US
    action: drop
    logging: yes
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Add a new policy rule that uses an existing rule list
  bigip_firewall_rule:
    name: foo
    parent_policy: foo_policy
    rule_list: rule-list1
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s�
name:
  description: Name of the rule.
  returned: changed
  type: str
  sample: FooRule
parent_policy:
  description: The policy which contains the rule to be managed.
  returned: changed
  type: str
  sample: FooPolicy
parent_rule_list:
  description: The rule list which contains the rule to be managed.
  returned: changed
  type: str
  sample: FooRuleList
action:
  description: The action for the firewall rule.
  returned: changed
  type: str
  sample: drop
status:
  description: The activity state of the rule or rule list.
  returned: changed
  type: str
  sample: scheduled
schedule:
  description: The schedule for the firewall rule.
  returned: changed
  type: str
  sample: Foo_schedule
description:
  description: The rule description.
  returned: changed
  type: str
  sample: MyRule
irule:
  description: The iRule that is applied to the firewall rule.
  returned: changed
  type: str
  sample: _sys_auth_radius
protocol:
  description: The protocol to which the rule applies.
  returned: changed
  type: str
  sample: any
source:
  description: The packet sources to which the rule applies
  returned: changed
  type: complex
  contains:
    address:
      description: A specific IP address.
      returned: changed
      type: str
      sample: 192.168.1.1
    address_list:
      description: An existing address list.
      returned: changed
      type: str
      sample: foo-list1
    address_range:
      description: The address range.
      returned: changed
      type: str
      sample: 1.1.1.1-2.2.2.2
    country:
      description: A country code.
      returned: changed
      type: str
      sample: US
    port:
      description: Single numeric port.
      returned: changed
      type: int
      sample: 8080
    port_list:
      description: An existing port list.
      returned: changed
      type: str
      sample: port-list1
    port_range:
      description: The port range.
      returned: changed
      type: str
      sample: 80-443
    vlan:
      description: Source VLANs for the packets.
      returned: changed
      type: str
      sample: vlan1
  sample: hash/dictionary of values
destination:
  description: The packet destinations to which the rule applies.
  returned: changed
  type: complex
  contains:
    address:
      description: A specific IP address.
      returned: changed
      type: str
      sample: 192.168.1.1
    address_list:
      description: An existing address list.
      returned: changed
      type: str
      sample: foo-list1
    address_range:
      description: The address range.
      returned: changed
      type: str
      sample: 1.1.1.1-2.2.2.2
    country:
      description: A country code.
      returned: changed
      type: str
      sample: US
    port:
      description: Single numeric port.
      returned: changed
      type: int
      sample: 8080
    port_list:
      description: An existing port list.
      returned: changed
      type: str
      sample: port-list1
    port_range:
      description: The port range.
      returned: changed
      type: str
      sample: 80-443
  sample: hash/dictionary of values
logging:
  description: Enable or Disable logging for the firewall rule.
  returned: changed
  type: bool
  sample: yes
rule_list:
  description: An existing rule list to use in the parent policy.
  returned: changed
  type: str
  sample: rule-list-1
icmp_message:
  description: The (ICMP) or ICMPv6 message C(type) and C(code) that the rule uses.
  returned: changed
  type: complex
  contains:
    type:
      description: The type of ICMP message.
      returned: changed
      type: str
      sample: 0
    code:
      description: The code returned in response to the specified ICMP message type.
      returned: changed
      type: str
      sample: 1
  sample: hash/dictionary of values
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_namet
ParameterscB`s�eZidd6dd6dd6dd6Zdddd	d
dddd
ddgZdddddd
d
d	dddgZdddddd
d
d	dddgZidd6dd6dd6dd6dd6ZRS(tprotocolt
ipProtocoltloggingtlogticmp_messageticmpt	rule_listtruleListtiruletscheduleRtdestinationtsourcetactiontdescriptiont1ttcpt6tudpt17ticmpv6t58tanyt255(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatablestprotocol_map(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�sX
			t
ApiParameterscB`sSeZed��Zed��Zed��Zed��Zed��ZRS(cC`s2|jddkrdS|jddkr.tStS(NRtyes(t_valuestNonetTruetFalse(tself((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR2s
cC`sJ|jddkrdS|jd|jkr?|j|jdS|jdS(NR(R1R2R.(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR:s
cC`s�g}|jddkrdS|jd}d|kr`|g|dD]}d|f^qD7}nd|kr�|g|dD]}d|f^qz7}nd|kr�|g|dD]}d|df^q�7}nd|kr
|g|dD]}d	|df^q�7}nd
|krJ|g|d
D]}dt|d�f^q$7}nd|kr�|g|dD]}d
|f^qd7}n|r�|SdS(NRtaddressListstaddress_listtvlanstvlantgeotnamet	addressestaddresstportstportt	portListst	port_list(R1R2tstr(R5tresulttvtx((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyRBs&
**..4*cC`sRg}|jddkrdS|jd}d|kr`|g|dD]}d|f^qD7}nd|kr�|g|dD]}d|df^qz7}nd|kr�|g|dD]}d|df^q�7}nd|kr|g|dD]}d	|df^q�7}nd
|krD|g|d
D]}d|f^q(7}n|rN|SdS(NRR6R7R:R;R<R=R>R?R@RA(R1R2(R5RCRDRE((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyRXs"
*...*cC`s?|jddkrdSg|jdD]}|d^q%}|S(NRR;(R1R2(R5RERC((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyRls$(R(R)tpropertyRRRRR(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR/1s
tModuleParameterscB`sqeZed��Zed��Zed��Zed��Zed��Zed��Zed��Z	RS(cC`sE|jddkrdS|jddkr.dSt|j|jd�S(NRt(R1R2R
t	partition(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyRus
cC`s9|jddkrdS|jddkr.dS|jdS(NRRH(R1R2(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR}s
cC`sE|jddkrdS|jddkr.dSt|j|jd�S(NRRH(R1R2R
RI(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�s
cC`sg}|jddkrdSx�|jdD]�}d|krg|ddk	rg|d|dfg7}q+d|kr�|ddk	r�|d|dfg7}q+d|kr�|ddk	r�|d|dfg7}q+d|kr	|ddk	r	|d|dfg7}q+d|krK|ddk	rK|dt|j|d�fg7}q+d|kr�|ddk	r�|dt|d�fg7}q+d	|kr�|d	dk	r�|d|d	fg7}q+d
|kr+|d
dk	r+|d
t|j|d
�fg7}q+q+W|r
|SdS(NRR=t
address_rangeR7tcountryR:R9R?t
port_rangeRA(R1R2R
RIRB(R5RCRE((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�s.& *cC`s�g}|jddkrdSx�|jdD]�}d|krg|ddk	rg|d|dfg7}q+d|kr�|ddk	r�|d|dfg7}q+d|kr�|ddk	r�|d|dfg7}q+d|kr	|ddk	r	|d|dfg7}q+d|krE|ddk	rE|dt|d�fg7}q+d|kr{|ddk	r{|d|dfg7}q+d	|kr+|d	dk	r+|d	t|j|d	�fg7}q+q+W|r�|SdS(
NRR=RJR7RKR:R?RLRA(R1R2RBR
RI(R5RCRE((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�s* *c	C`s5|jddkrdSg}x�|jdD]�}|jdd�}|jdd�}|dksm|dkrvd}n|dks�|dkr�d}n|dkr�|dkr�|jd�q+|dkr�|dkr�td��q+|dkr|j|�q+|jdj||��q+Wtt|��}|S(NRttypeR'tcodeR&s/A type of 'any' (255) requires a code of 'any'.s{0}:{1}(R1R2tgettappendRtformattlisttset(R5RCRERMRN((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�s(		cC`sE|jddkrdS|jddk	rAt|j|jd�SdS(NRt
parent_policy(R1R2R
RI(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�s
(
R(R)RFRRRRRRR(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyRGtstChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R,tgetattrt_filter_paramst	Exception(R5RCt
returnable((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyt	to_return�s
(R(R)RZ(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyRU�st
UsableChangescB`sDeZed��Zed��Zed��Zed��ZRS(cC`s2|jddkrdS|jdtkr.dSdS(NRR0tno(R1R2R3(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�s
c
C`sk|jddkrdStdgdgdgdgdgdg�}x |jdD]}|dd	kr�|dji|d
d6�qR|ddkr�|dj|d
�qR|dd
kr�|dj|d
�qR|ddkr|dji|d
d6�qR|ddkr;|djit|d
�d6�qR|ddkrR|dj|d
�qRqRW|S(NRR<R6R8R:R>R@iR=iR;R7R9R?RA(R1R2tdictRPRB(R5RCRE((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�s.	%c
C`sC|jddkrdStdgdgdgdgdgdg�}x�|jdD]�}|dd	kr�|dji|d
d6�qR|ddkr�|dj|d
�qR|ddkr�|dji|d
d6�qR|dd
kr|djit|d
�d6�qR|ddkrR|dj|d
�qRqRW|S(NRR<R6R8R:R>R@iR=iR;R7R?RA(R1R2R]RPRB(R5RCRE((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyRs*	%cC`sM|jddkrdSg}x)|jdD]}|ji|d6�q+W|S(NRR;(R1R2RP(R5RCRE((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR,s(R(R)RFRRRR(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR[�stReportableChangescB`s&eZed��Zed��ZRS(cC`s�|jddkrdSg}|jd}|dr^|g|dD]}d|f^qB7}n|dr�|g|dD]}d|f^qv7}n|dr�|g|dD]}d|df^q�7}n|dr|g|dD]}d	|df^q�7}n|d
r<|g|d
D]}dt|�f^q7}n|drt|g|dD]}d
|df^qT7}n|r�t|�SdS(NRR6R7R8R9R:R;R<R=R>R?R@RA(R1R2RBR](R5RCRDRE((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR7s&

*
*
.
.
0
.
cC`sT|jddkrdSg}|jd}|dr^|g|dD]}d|f^qB7}n|dr�|g|dD]}d|df^qv7}n|dr�|g|dD]}d|df^q�7}n|dr|g|dD]}d	t|�f^q�7}n|d
r@|g|d
D]}d|df^q 7}n|rPt|�SdS(NRR6R7R:R;R<R=R>R?R@RA(R1R2RBR](R5RCRDRE((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyRMs"

*
.
.
0
.
(R(R)RFRR(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR^6st
DifferencecB`sqeZdd�Zd�Zd�Zed��Zed��Zed��Z	ed��Z
ed��ZRS(	cC`s||_||_dS(N(twantthave(R5R`Ra((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyt__init__cs	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(RVtAttributeErrort_Difference__default(R5tparamRC((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pytcomparegs

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(RVR`RaRc(R5Retattr1tattr2((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyt	__defaultns
cC`s�|jjdkrdS|jjdkr>|jjdkr>dS|jjdkrZ|jjS|jj|jjkr||jjSdS(NRH(R`RR2Ra(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyRws$
cC`s�|jjdkrdS|jjdkr>|jjdkr>dS|jjdkrZ|jjS|jj|jjkr||jjSdS(NRH(R`RR2Ra(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�s$
cC`s�|jjdkrdS|jjdkr>|jjdkr>dS|jjdkrZ|jjSt|jj�t|jj�kr�|jjSdS(N(R`RR2RaRS(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�s$
$cC`s�|jjdkrdS|jjdkr>|jjdkr>dS|jjdkrZ|jjSt|jj�t|jj�kr�|jjSdS(N(R`RR2RaRS(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�s$
$cC`s�|jjdkrdS|jjdkr>|jjdkr>dS|jjdkrZ|jjSt|jj�t|jj�kr�|jjSdS(N(R`RR2RaRS(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�s$
$N(R(R)R2RbRfRdRFRRRRR(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR_bs			t
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�ZRS(cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(ROR2RkR
RltclientRGR`R/RaR[tchanges(R5targstkwargs((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyRb�s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRl(RR,RVR`R2R[Rn(R5tchangedtkey((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyt_set_changed_options�scC`s�t|j|j�}tj}t�}xX|D]P}|j|�}|dkrUq.q.t|t�rt|j	|�q.|||<q.W|r�t
d|�|_tSt
S(NRl(R_R`RaRR-R]RfR2t
isinstancetupdateR[RnR3R4(R5tdiffR-Rqtktchange((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyt_update_changed_options�s		
cC`s|j�}|rtStS(N(RyR3R4(R5RC((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyt
should_update�scC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRlRq(R4R]R`tstateR{R|R^RnRZRut_announce_deprecations(R5RqRCR}t
reportableRn((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pytexec_module�s	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRmRkt	deprecate(R5RCtwarningstwarning((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR~�s


cC`s$|j�r|j�S|j�SdS(N(texistsRutcreate(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR{�s
cC`s�|jj}|jjrhdj|jjd|jjdt|jj|jj�|jdd��}nMdj|jjd|jjdt|jj|jj	�|jdd��}|jj
j|�}|jr�t
StS(Ns>https://{0}:{1}/mgmt/tm/security/firewall/policy/{2}/rules/{3}tservertserver_portt/t_sAhttps://{0}:{1}/mgmt/tm/security/firewall/rule-list/{2}/rules/{3}(R`R;RTRQRmtproviderRRItreplacetparent_rule_listtapiROtokR3R4(R5R;turitresp((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR��s 



	cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceRaRzR4Rkt
check_modeR3tupdate_on_device(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyRus
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(RkR�R3tremove_from_deviceR�R(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pytremoves
cC`se|j�|j�|jjdkrG|jjdkrGtd��n|jjrWt	S|j
�t	S(Nt	scheduleds<A 'schedule' must be specified when 'status' is 'scheduled'.(Rst set_reasonable_creation_defaultsR`RRR2RRkR�R3tcreate_on_device(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�s

$
cC`s�|jjdkr,|jjidd6�n|jjdkrX|jjitd6�n|jjdkr�|jjidd6�ndS(NtrejectRRtenabledR(R`RR2RnRuRR4R(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�(scC`s�|jj�}|jj}|jdd�|d<|jj|d<d|d<|jjr�dj|jj	d|jj	d	t
|jj|jj��}n>d
j|jj	d|jj	d	t
|jj|jj��}|jjdkr|jj
dk	rtd
��qn|jjj|d|�}y|j�}Wn%tk
r^}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j��ndS(NR�R�R;RItlastt
placeAfters;https://{0}:{1}/mgmt/tm/security/firewall/policy/{2}/rules/R�R�s>https://{0}:{1}/mgmt/tm/security/firewall/rule-list/{2}/rules/RR$sOThe 'icmp_message' can only be specified when 'protocol' is 'icmp' or 'icmpv6'.tjsonRNi�i�i�tmessage(sicmpsicmpv6(i�i�i�(Rnt
api_paramsR`R;R�RIRTRQRmR�RR�RRR2RR�tpostR�t
ValueErrorRBtcontent(R5RlR;R�R�tresponsetex((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�0s6


!

cC`s[|jj}|jjrt|jjrtdj|jjd|jjdt|jj|jj�|j	dd��}n�|jjr�dj|jjd|jjdt|jj|jj�|j	dd��}nMdj|jjd|jjdt|jj|jj
�|j	dd��}|jjdkre|j
jdkre|j
jdk	retd	��qen|j
jdkr�|j
jiid
6�|j
jiid6�n|j
j�}|jjj|d|�}y|j�}Wn%tk
r	}tt|���nXd
|krW|d
dkrWd|krEt|d��qWt|j��ndS(Ns>https://{0}:{1}/mgmt/tm/security/firewall/policy/{2}/rules/{3}R�R�R�R�sAhttps://{0}:{1}/mgmt/tm/security/firewall/rule-list/{2}/rules/{3}RR$sOThe 'icmp_message' can only be specified when 'protocol' is 'icmp' or 'icmpv6'.RRR�RNi�i�i�R�(sicmpsicmpv6(sicmpsicmpv6(sicmpsicmpv6(i�i�i�(R`R;RTRRQRmR�RRIR�R�RaRRnRR2RRuR�R�tpatchR�R�RBR�(R5R;R�RlR�R�R�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR�UsF





$cC`s|j�r|j�StS(N(R�R�R4(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR|�s
cC`s�|jj}|jjrhdj|jjd|jjdt|jj|jj�|jdd��}nMdj|jjd|jjdt|jj|jj	�|jdd��}|jj
j|�}|jdkr�t
SdS(Ns>https://{0}:{1}/mgmt/tm/security/firewall/policy/{2}/rules/{3}R�R�R�R�sAhttps://{0}:{1}/mgmt/tm/security/firewall/rule-list/{2}/rules/{3}i�(R`R;RTRQRmR�RRIR�R�R�tdeleteRR3(R5R;R�R�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR��s



cC`sD|jjrVdj|jjd|jjdt|jj|jj�|jj�}nGdj|jjd|jjdt|jj|jj�|jj�}|jj	j
|�}y|j�}Wn%tk
r�}t
t|���nXd|kr7|ddkr7d|kr%t
|d��q7t
|j��ntd|�S(	Ns>https://{0}:{1}/mgmt/tm/security/firewall/policy/{2}/rules/{3}R�R�sAhttps://{0}:{1}/mgmt/tm/security/firewall/rule-list/{2}/rules/{3}RNi�R�Rl(R`RTRQRmR�RRIR;R�R�ROR�R�RRBR�R/(R5R�R�R�R�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR��s*



(R(R)RbRsRyRzR�R~R{R�RuR�R�R�R�R�R|R�R�(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyRj�s"														%	/		tArgumentSpeccB`seZd�ZRS(c'C`s�t|_tdtdt�dt�dt�dtdd�dt�d	t�d
t�dtddd
ddtdt�dt�dt�dt�dtdd�dt�dt�dt��dddddddddgg�dtddd
ddtdt�dt�dt�dt�dtdd�dt�dt��ddddddddgg�dtddddd g�d!tdd"d#d$g�d%t�d&t�d'tddd
ddtdt�d(t���d)td*d+d,td-gf�d.td*d/dd/d0g��}i|_|jjt�|jj|�d&dgd&dgd&dgd&d	gd&dgd&dgddgg|_ddgg|_dS(1NR;trequiredRTR�RRMtboolRRRRRRtelementsR]toptionsR=R7RJRKR?tintRARLR9tmutually_exclusiveRRtchoicestaccepttdropR�saccept-decisivelyRR�tdisabledR�RRRRNRItdefaulttCommontfallbacktF5_PARTITIONR}R{R|(	R3tsupports_check_modeR]R	t
argument_specRuRR�trequired_one_of(R5R�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyRb�s�																											(R(R)Rb(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyR��sc	C`s�t�}td|jd|jd|jd|j�}y,td|�}|j�}|j|�Wn)t	k
r�}|j
dt|��nXdS(NR�R�R�R�RkR�(R�RR�R�R�R�RjR�t	exit_jsonRt	fail_jsonRB(tspecRktmmtresultsR�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pytmains				t__main__N($t
__future__RRRRMt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRR	t%library.module_utils.network.f5.bigipR
t&library.module_utils.network.f5.commonRRR
RRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonRR/RGRUR[R^tobjectR_RjR�R�R((((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_rule.pyt<module>sH


�>�
;CoG,M�X	

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]