|
|
@ -108,6 +108,7 @@ import time
|
|
|
|
|
|
|
|
|
|
|
|
ISCSIADM = 'iscsiadm'
|
|
|
|
ISCSIADM = 'iscsiadm'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def compare_nodelists(l1, l2):
|
|
|
|
def compare_nodelists(l1, l2):
|
|
|
|
|
|
|
|
|
|
|
|
l1.sort()
|
|
|
|
l1.sort()
|
|
|
@ -330,17 +331,17 @@ def main():
|
|
|
|
result['nodes'] = nodes
|
|
|
|
result['nodes'] = nodes
|
|
|
|
|
|
|
|
|
|
|
|
if login is not None:
|
|
|
|
if login is not None:
|
|
|
|
loggedon = target_loggedon(module,target)
|
|
|
|
loggedon = target_loggedon(module, target)
|
|
|
|
if (login and loggedon) or (not login and not loggedon):
|
|
|
|
if (login and loggedon) or (not login and not loggedon):
|
|
|
|
result['changed'] |= False
|
|
|
|
result['changed'] |= False
|
|
|
|
if login:
|
|
|
|
if login:
|
|
|
|
result['devicenodes'] = target_device_node(module,target)
|
|
|
|
result['devicenodes'] = target_device_node(module, target)
|
|
|
|
elif not check:
|
|
|
|
elif not check:
|
|
|
|
if login:
|
|
|
|
if login:
|
|
|
|
target_login(module, target)
|
|
|
|
target_login(module, target)
|
|
|
|
# give udev some time
|
|
|
|
# give udev some time
|
|
|
|
time.sleep(1)
|
|
|
|
time.sleep(1)
|
|
|
|
result['devicenodes'] = target_device_node(module,target)
|
|
|
|
result['devicenodes'] = target_device_node(module, target)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
target_logout(module, target)
|
|
|
|
target_logout(module, target)
|
|
|
|
result['changed'] |= True
|
|
|
|
result['changed'] |= True
|
|
|
@ -368,7 +369,6 @@ def main():
|
|
|
|
module.exit_json(**result)
|
|
|
|
module.exit_json(**result)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# import module snippets
|
|
|
|
# import module snippets
|
|
|
|
from ansible.module_utils.basic import *
|
|
|
|
from ansible.module_utils.basic import *
|
|
|
|
|
|
|
|
|
|
|
|