�
�Udac @` s� d d l m Z m Z m Z e Z i d g d 6d d 6d d 6Z d Z d Z d
Z d d l
m Z d d l m
Z
m Z m Z m Z d
� Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functiont previewt statust communityt supported_bys 1.1t metadata_versions�
---
module: ibm_sa_host_ports
short_description: Add host ports on IBM Spectrum Accelerate Family storage systems.
version_added: "2.8"
description:
- "This module adds ports to or removes them from the hosts
on IBM Spectrum Accelerate Family storage systems."
options:
host:
description:
- Host name.
required: true
state:
description:
- Host ports state.
required: true
default: "present"
choices: [ "present", "absent" ]
iscsi_name:
description:
- iSCSI initiator name.
required: false
fcaddress:
description:
- Fiber channel address.
required: false
num_of_visible_targets:
description:
- Number of visible targets.
required: false
extends_documentation_fragment:
- ibm_storage
author:
- Tzur Eliyahu (@tzure)
s�
- name: Add ports for host.
ibm_sa_host_ports:
host: test_host
iscsi_name: iqn.1994-05.com***
username: admin
password: secret
endpoints: hostdev-system
state: present
- name: Remove ports for host.
ibm_sa_host_ports:
host: test_host
iscsi_name: iqn.1994-05.com***
username: admin
password: secret
endpoints: hostdev-system
state: absent
t
( t
AnsibleModule( t execute_pyxcli_commandt connect_sslt spectrum_accelerate_spect is_pyxcli_installedc
C` s� t � } | j t d t d d d d d g � d t d t � d t � d t � d
t � � � t | � } t | � t | � } g } y( | j j d | j j
d � � j } Wn t k
r� n X| j d } t
} g | D] } | j
d � ^ q� } | j j
d � r| j j
d � n g } | j j
d � rE| j j
d � n g } x0 | D]( } | | k sp| | k rRt } PqRqRWt
} | d k r�| r�t | d | � } n | d k r�| r�t | d
| � } n | j d | � d S( Nt statet defaultt presentt choicest absentt hostt requiredt
iscsi_namet fcaddresst num_of_visible_targetst port_namet
host_add_portt host_remove_portt changed( R t updatet dictt TrueR R
R t cmdt host_list_portst paramst gett as_listt Exceptiont FalseR
t exit_json(
t
argument_spect modulet xcli_clientt portsR t port_existst portt fc_portst iscsi_portst
state_changed( ( sQ /usr/lib/python2.7/site-packages/ansible/modules/storage/ibm/ibm_sa_host_ports.pyt mainU sD
"**
t __main__N( t
__future__R R R t typet
__metaclass__t ANSIBLE_METADATAt
DOCUMENTATIONt EXAMPLESt RETURNt ansible.module_utils.basicR t! ansible.module_utils.ibm_sa_utilsR
R R R
R0 t __name__( ( ( sQ /usr/lib/python2.7/site-packages/ansible/modules/storage/ibm/ibm_sa_host_ports.pyt <module> s
)" .
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]