|
|
@ -55,10 +55,23 @@ class ActionModule(ActionNetworkModule):
|
|
|
|
self._task.args['username'] = self._play_context.connection_user
|
|
|
|
self._task.args['username'] = self._play_context.connection_user
|
|
|
|
|
|
|
|
|
|
|
|
if self._task.action == 'nxos_install_os':
|
|
|
|
if self._task.action == 'nxos_install_os':
|
|
|
|
|
|
|
|
persistent_command_timeout = 0
|
|
|
|
|
|
|
|
persistent_connect_timeout = 0
|
|
|
|
connection = self._connection
|
|
|
|
connection = self._connection
|
|
|
|
if connection.get_option('persistent_command_timeout') < 600 or connection.get_option('persistent_connect_timeout') < 600:
|
|
|
|
if connection.transport == 'local':
|
|
|
|
|
|
|
|
persistent_command_timeout = C.PERSISTENT_COMMAND_TIMEOUT
|
|
|
|
|
|
|
|
persistent_connect_timeout = C.PERSISTENT_CONNECT_TIMEOUT
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
persistent_command_timeout = connection.get_option('persistent_command_timeout')
|
|
|
|
|
|
|
|
persistent_connect_timeout = connection.get_option('persistent_connect_timeout')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
display.vvvv('PERSISTENT_COMMAND_TIMEOUT is %s' % str(persistent_command_timeout), self._play_context.remote_addr)
|
|
|
|
|
|
|
|
display.vvvv('PERSISTENT_CONNECT_TIMEOUT is %s' % str(persistent_connect_timeout), self._play_context.remote_addr)
|
|
|
|
|
|
|
|
if persistent_command_timeout < 600 or persistent_connect_timeout < 600:
|
|
|
|
msg = 'PERSISTENT_COMMAND_TIMEOUT and PERSISTENT_CONNECT_TIMEOUT'
|
|
|
|
msg = 'PERSISTENT_COMMAND_TIMEOUT and PERSISTENT_CONNECT_TIMEOUT'
|
|
|
|
msg += ' must be set to 600 seconds or higher when using nxos_install_os module'
|
|
|
|
msg += ' must be set to 600 seconds or higher when using nxos_install_os module.'
|
|
|
|
|
|
|
|
msg += ' Current persistent_command_timeout setting:' + str(persistent_command_timeout)
|
|
|
|
|
|
|
|
msg += ' Current persistent_connect_timeout setting:' + str(persistent_connect_timeout)
|
|
|
|
return {'failed': True, 'msg': msg}
|
|
|
|
return {'failed': True, 'msg': msg}
|
|
|
|
|
|
|
|
|
|
|
|
if self._play_context.connection in ('network_cli', 'httpapi'):
|
|
|
|
if self._play_context.connection in ('network_cli', 'httpapi'):
|
|
|
|