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_global_rules.pyo

�
�Udac@`s#ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZydddlm
Z
dd
lmZddlmZddlmZddlmZddlmZWnqek
r9ddlm
Z
dd
lmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZ d efd!��YZ!d"efd#��YZ"d$�Z#e$d%kre#�nd&S('i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
---
module: bigip_firewall_global_rules
short_description: Manage AFM global rule settings on BIG-IP
description:
  - Configures the global network firewall rules. These firewall rules are
    applied to all packets except those going through the management
    interface. They are applied first, before any firewall rules for the
    packet's virtual server, route domain, and/or self IP.
version_added: 2.8
options:
  enforced_policy:
    description:
      - Specifies an enforced firewall policy.
      - C(enforced_policy) rules are enforced globally.
    type: str
  service_policy:
    description:
      - Specifies a service policy that would apply to traffic globally.
      - The service policy is applied to all flows, provided if there are
        no other context specific service policy configuration that
        overrides the global service policy. For example, when a service
        policy is configured both at a global level, as well as on a
        firewall rule, and a flow matches the rule, the more specific
        service policy configuration in the rule will override the service
        policy setting at the global level.
      - The service policy associated here can be created using the
        C(bigip_service_policy) module.
    type: str
  staged_policy:
    description:
      - Specifies a staged firewall policy.
      - C(staged_policy) rules are not enforced while all the visibility
        aspects namely statistics, reporting and logging function as if
        the staged-policy rules were enforced globally.
    type: str
  description:
    description:
      - Description for the global list of firewall rules.
    type: str
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
s�
- name: Change enforced policy in AFM global rules
  bigip_firewall_global_rules:
    enforced_policy: enforcing1
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s�
enforced_policy:
  description: The new global Enforced Policy.
  returned: changed
  type: str
  sample: /Common/enforced1
service_policy:
  description: The new global Service Policy.
  returned: changed
  type: str
  sample: /Common/service1
staged_policy:
  description: The new global Staged Policy.
  returned: changed
  type: str
  sample: /Common/staged1
description:
  description: The new description.
  returned: changed
  type: str
  sample: My description
(t
AnsibleModule(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(tcmp_str_with_nonet
ParameterscB`sYeZidd6dd6dd6ZddddgZddddgZddddgZRS(tenforced_policytenforcedPolicytservice_policyt
servicePolicyt
staged_policytstagedPolicytdescription(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyRps 
		t
ApiParameterscB`seZed��ZRS(cC`s"|jddkrdS|jdS(NRtnone(NR(t_valuestNone(tself((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR�s(RRtpropertyR(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR�stModuleParameterscB`sDeZed��Zed��Zed��Zed��ZRS(cC`sE|jddkrdS|jddkr.dSt|j|jd�S(NRtR(R$snone(RR Rt	partition(R!((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR�s
cC`sE|jddkrdS|jddkr.dSt|j|jd�S(NRR$R(R$snone(RR RR%(R!((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR�s
cC`sE|jddkrdS|jddkr.dSt|j|jd�S(NRR$R(R$snone(RR RR%(R!((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR�s
cC`s9|jddkrdS|jddkr.dS|jdS(NRRR$(snoneR$(RR (R!((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR�s
(RRR"RRRR(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR#�stChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(Rtgetattrt_filter_paramst	Exception(R!tresultt
returnable((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyt	to_return�s
(RRR,(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR&�st
UsableChangescB`seZRS((RR(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR-�stReportableChangescB`seZRS((RR(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR.�st
DifferencecB`sbeZdd�Zd�Zd�Zed��Zed��Zed��Z	ed��Z
RS(cC`s||_||_dS(N(twantthave(R!R0R1((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R'tAttributeErrort_Difference__default(R!tparamR*((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R'R0R1R3(R!R5tattr1tattr2((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyt	__default�s
cC`st|jj|jj�S(N(RR0RR1(R!((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR�scC`st|jj|jj�S(N(RR0RR1(R!((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR�scC`st|jj|jj�S(N(RR0RR1(R!((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR�scC`st|jj|jj�S(N(RR0RR1(R!((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR�sN(RRR R2R6R4R"RRRR(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR/�s			t
ModuleManagercB`sbeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(tgetR R;R	R<tclientR#R0RR1R-tchanges(R!targstkwargs((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR2�s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NR<(RRR'R0R R-R?(R!tchangedtkey((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.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(NR<(R/R0R1RRtdictR6R t
isinstancetupdateR-R?tTruetFalse(R!tdiffRRBtktchange((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyt_update_changed_optionss		
cC`s|j�}|rtStS(N(RMRHRI(R!R*((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyt
should_updatescC`smt�}|j�}td|jj��}|j�}|j|�|jtd|��|j|�|S(NR<RB(REtpresentR.R?R,RGt_announce_deprecations(R!R*RBt
reportableR?((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pytexec_modules	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopR>R;t	deprecate(R!R*twarningstwarning((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyRP%s


cC`s
|j�S(N(RG(R!((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyRO-scC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR1RNRIR;t
check_modeRHtupdate_on_device(R!((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyRG0s
cC`s�|jj�}dj|jjd|jjd�}|jjj|d|�}y|j�}Wn%tk
r�}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��ndS(Ns6https://{0}:{1}/mgmt/tm/security/firewall/global-rulestservertserver_porttjsontcodei�tmessage(R?t
api_paramstformatR>tprovidertapitpatchR_t
ValueErrorR
tstrtcontent(R!R<turitresptresponsetex((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR\9s
cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��nt
d|�S(Ns6https://{0}:{1}/mgmt/tm/security/firewall/global-rulesR]R^R`i�RaR<(RcR>RdReR=R_RgR
RhRiR(R!RjRkRlRm((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyRZKs
(RRR2RDRMRNRRRPRORGR\RZ(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR:�s										tArgumentSpeccB`seZd�ZRS(c	C`sct|_tdt�dt�dt�dt��}i|_|jjt�|jj|�dS(NRRRR(RHtsupports_check_modeREt
argument_specRGR
(R!Rp((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyR2_s					(RRR2(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyRn^scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NRpRoR;RT(
RnRRpRoR:RRt	exit_jsonR
t	fail_jsonRh(tspecR;tmmtresultsRm((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pytmainls		t__main__N(%t
__future__RRRttypet
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt%library.module_utils.network.f5.bigipR	t&library.module_utils.network.f5.commonR
RRR
t'library.module_utils.network.f5.compareRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont'ansible.module_utils.network.f5.compareRRR#R&R-R.tobjectR/R:RnRvR(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_global_rules.pyt<module>sD


-
"&m	

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