Anons79 Mini Shell

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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlZddlm
Z
dd
lmZddlmZd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: bcf_switch
author: "Ted (@tedelhourani)"
short_description: Create and remove a bcf switch.
description:
    - Create and remove a Big Cloud Fabric switch.
version_added: "2.4"
options:
  name:
    description:
     - The name of the switch.
    required: true
  fabric_role:
    description:
     - Fabric role of the switch.
    choices: ['spine', 'leaf']
    required: true
  leaf_group:
    description:
     - The leaf group of the switch if the switch is a leaf.
    required: false
  mac:
    description:
     - The MAC address of the switch.
    required: true
  state:
    description:
     - Whether the switch should be present or absent.
    default: present
    choices: ['present', 'absent']
  controller:
    description:
     - The controller IP address.
    required: true
  validate_certs:
    description:
      - If C(false), SSL certificates will not be validated. This should only be used
        on personally controlled devices using self-signed certificates.
    required: false
    default: true
    type: bool
  access_token:
    description:
     - Big Cloud Fabric access token. If this isn't set then the environment variable C(BIGSWITCH_ACCESS_TOKEN) is used.
s�
- name: bcf leaf switch
  bcf_switch:
    name: Rack1Leaf1
    fabric_role: leaf
    leaf_group: R1
    mac: 00:00:00:02:00:02
    controller: '{{ inventory_hostname }}'
    state: present
    validate_certs: false
s # N(t
AnsibleModule(tRest(t	to_nativec	C`s�y|jdptjd}Wn6tk
rV}|jdd|jdtj��nX|jd}|jd}|jd}d	|jd
}|jd}|jd}	t|id
d6d|d6d|	d�}
|
j	ddi�}|j
dkr|jddj|jd��nt
}xi|jD]^}
t|
d|k|
d|k|
d|kf�r,|
j	dd�|k}|r�Pq�q,q,W|dkr�|r�|jdt
�n|dkr�|r�|jdt
�n|r�|jdt�n|dkr~i|d6|d6|d6|d6}|
jd||�}|j
dkrX|jdt�q~|jdd j||jd��n|dkr�|
jd|di�}|j
dkr�|jdt�q�|jdd!j||jd��ndS("Ntaccess_tokentBIGSWITCH_ACCESS_TOKENtmsgsUnable to load %st	exceptiontnametfabric_rolet
leaf_groups00:00:tmactstatet
controllersapplication/jsonscontent-typessession_cookie=tCookieshttps://s!:8443/api/v1/data/controller/cores
switch-configtdatai�s,failed to obtain existing switch config: {0}tdescriptionsfabric-roletdpids
leaf-grouptpresenttchangedtabsentsswitch-config[name="%s"]i�s#error configuring switch '{0}': {1}s error deleting switch '{0}': {1}(tparamstostenvirontKeyErrort	fail_jsontmessaget	tracebackt
format_excR	tgettstatus_codetformattjsontFalsetalltNonet	exit_jsontTruetputtdelete(tmodulet
check_modeRteRRRRRRtresttresponsetconfig_presenttswitchR((sP/usr/lib/python2.7/site-packages/ansible/modules/network/bigswitch/bcf_switch.pyR5UsR'




#
"&cC`stdtdtdddt�dtddd	gdt�d
tdddt�dtdddt�dtdddt�d
tdddgdd�dtdddd�dtdddt��dt�}yt|d|j�Wn5tk
r}|jdt|�dt	j
��nXdS(Nt
argument_specRttypetstrtrequiredRtchoicestspinetleafRRRRRRtdefaulttvalidate_certstboolR,Rtno_logtsupports_check_modeR0R
R(RtdictR,R(R5R0t	ExceptionR R
R"R#(R/R1((sP/usr/lib/python2.7/site-packages/ansible/modules/network/bigswitch/bcf_switch.pytmain�s	t__main__(t
__future__RRRR7t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRR"tansible.module_utils.basicRt0ansible.module_utils.network.bigswitch.bigswitchR	tansible.module_utils._textR
R5RDt__name__(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/bigswitch/bcf_switch.pyt<module>s 


/
	7	

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