??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177

Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
 Udac@`s ddlmZmZmZeZidd6dgd6dd6ZdZd Zdd l Z dd l Z dd l Z dd l m Z d Zd Zd dZdZdZd d dZdZdZdZdZdZdZedkrend S(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust communityt supported_bys --- module: open_iscsi author: - Serge van Ginderachter (@srvg) version_added: "1.4" short_description: Manage iSCSI targets with Open-iSCSI description: - Discover targets on given portal, (dis)connect targets, mark targets to manually or auto start, return device nodes of connected targets. requirements: - open_iscsi library and tools (iscsiadm) options: portal: description: - The IP address of the iSCSI target. type: str aliases: [ ip ] port: description: - The port on which the iSCSI target process listens. type: str default: 3260 target: description: - The iSCSI target name. type: str aliases: [ name, targetname ] login: description: - Whether the target node should be connected. type: bool aliases: [ state ] node_auth: description: - The value for C(discovery.sendtargets.auth.authmethod). type: str default: CHAP node_user: description: - The value for C(discovery.sendtargets.auth.username). type: str node_pass: description: - The value for C(discovery.sendtargets.auth.password). type: str auto_node_startup: description: - Whether the target node should be automatically connected at startup. type: bool aliases: [ automatic ] discover: description: - Whether the list of target nodes on the portal should be (re)discovered and added to the persistent iSCSI database. - Keep in mind that C(iscsiadm) discovery resets configuration, like C(node.startup) to manual, hence combined with C(auto_node_startup=yes) will always return a changed state. type: bool show_nodes: description: - Whether the list of nodes in the persistent iSCSI database should be returned by the module. type: bool s - name: Perform a discovery on 10.1.2.3 and show available target nodes open_iscsi: show_nodes: yes discover: yes portal: 10.1.2.3 # NOTE: Only works if exactly one target is exported to the initiator - name: Discover targets on portal and login to the one available open_iscsi: portal: '{{ iscsi_target }}' login: yes discover: yes - name: Connect to the named target, after updating the local persistent database (cache) open_iscsi: login: yes target: iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d - name: Disconnect from the cached named target open_iscsi: login: no target: iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d N(t AnsibleModuletiscsiadmcC`s|j|j||kS(N(tsort(tl1tl2((sE/usr/lib/python2.7/site-packages/ansible/modules/system/open_iscsi.pytcompare_nodelistsqs  c C`s'dt}|j|\}}}|dkr|j}g}x|D]}|j} t| dkr|jddd|n| d} | djd} | d} |dks|| krG|j| qGqGWnI|d ks|d krd |krg}n|jd|d |d||S( Ns%s --mode nodeiitmsgserror parsing outputtcmdit:iiso records foundtrc(t iscsiadm_cmdt run_commandt splitlinestsplittlent fail_jsontNonetappend( tmoduletportalRRtoutterrtlinestnodestlinetpartsttargett target_portal((sE/usr/lib/python2.7/site-packages/ansible/modules/system/open_iscsi.pytiscsi_get_cached_nodesws$       $ cC`sZdt||f}|j|\}}}|dkrV|jd|d|d|ndS(Ns5%s --mode discovery --type sendtargets --portal %s:%siRRR(RRR(RRtportRRRR((sE/usr/lib/python2.7/site-packages/ansible/modules/system/open_iscsi.pytiscsi_discovers cC`shdt}|j|\}}}|dkr8||kS|dkrHtS|jd|d|d|dS(Ns%s --mode sessioniiRRR(RRtFalseR(RR"RRRR((sE/usr/lib/python2.7/site-packages/ansible/modules/system/open_iscsi.pyttarget_loggedons    cC`sG|jd}|jd}|jd}|rd|fd|fd|fg}xp|D]e\}} dt||| f} |j| \} } } | dkrU|jd | d | d | qUqUWnd t|f} |dk r|dk r| d ||f7} n|j| \} } } | dkrC|jd | d | d | ndS(Nt node_autht node_usert node_passsnode.session.auth.authmethodsnode.session.auth.usernamesnode.session.auth.passwords?%s --mode node --targetname %s --op=update --name %s --value %siRRRs&%s --mode node --targetname %s --logins --portal %s:%s(tparamsRRRR(RR"RR%R)R*R+R,tnametvalueRRRR((sE/usr/lib/python2.7/site-packages/ansible/modules/system/open_iscsi.pyt target_logins$      & cC`sWdt|f}|j|\}}}|dkrS|jd|d|d|ndS(Ns'%s --mode node --targetname %s --logoutiRRR(RRR(RR"RRRR((sE/usr/lib/python2.7/site-packages/ansible/modules/system/open_iscsi.pyt target_logouts cC`sktjd|}g}xK|D]C}d|kr tjj|}||krc|j|qcq q W|S(Ns/dev/disk/by-path/*%s*s-part(tglobtostpathtrealpathR(RR"tdevicestdevdiskstdevtdevdisk((sE/usr/lib/python2.7/site-packages/ansible/modules/system/open_iscsi.pyttarget_device_nodes   cC`sdt|f}|j|\}}}|dkrk|j}x$|D]}d|krGd|kSqGWtS|jd|d|d|dS(Ns%s --mode node --targetname %sis node.startupt automaticRRR(RRRR'R(RR"RRRRRR ((sE/usr/lib/python2.7/site-packages/ansible/modules/system/open_iscsi.pyt target_isautos    cC`sWdt|f}|j|\}}}|dkrS|jd|d|d|ndS(NsP%s --mode node --targetname %s --op=update --name node.startup --value automaticiRRR(RRR(RR"RRRR((sE/usr/lib/python2.7/site-packages/ansible/modules/system/open_iscsi.pyttarget_setautos cC`sWdt|f}|j|\}}}|dkrS|jd|d|d|ndS(NsM%s --mode node --targetname %s --op=update --name node.startup --value manualiRRR(RRR(RR"RRRR((sE/usr/lib/python2.7/site-packages/ansible/modules/system/open_iscsi.pyttarget_setmanuals cC`stdtdtddddgdtdddd d tdddd d gd tdddddtdddtdddtdtddddgdtddddgdtdddtdtdddt dddgddggdt}|jddta|jd}|jd }|jd}|jd}|jd}|jd}|jd}|j}t||} i} t| d<|r%|dkr|j d d!n.|r| } nt |||t||} t | | s+| dctOs0   A             u