fix ansible_connect_timeout variable in connection plugins and nxos_install_os timeout check (#51209)
* fix ansible_connect_timeout variable in connection plugins and nxos_install_os timeout check (#50965)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit a1ea7e430a
)
* changelog
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
44474bf424
commit
bb28719541
5 changed files with 10 additions and 1 deletions
2
changelogs/fragments/fix_ansible_connect_timeout.yaml
Normal file
2
changelogs/fragments/fix_ansible_connect_timeout.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- fix ansible_connect_timeout variable in network_cli,netconf,httpapi and nxos_install_os timeout check
|
|
@ -56,7 +56,8 @@ class ActionModule(_ActionModule):
|
|||
self._task.args['username'] = self._play_context.connection_user
|
||||
|
||||
if self._task.action == 'nxos_install_os':
|
||||
if C.PERSISTENT_COMMAND_TIMEOUT < 600 or C.PERSISTENT_CONNECT_TIMEOUT < 600:
|
||||
connection = self._connection
|
||||
if connection.get_option('persistent_command_timeout') < 600 or connection.get_option('persistent_connect_timeout') < 600:
|
||||
msg = 'PERSISTENT_COMMAND_TIMEOUT and PERSISTENT_CONNECT_TIMEOUT'
|
||||
msg += ' must be set to 600 seconds or higher when using nxos_install_os module'
|
||||
return {'failed': True, 'msg': msg}
|
||||
|
|
|
@ -127,6 +127,8 @@ options:
|
|||
key: connect_timeout
|
||||
env:
|
||||
- name: ANSIBLE_PERSISTENT_CONNECT_TIMEOUT
|
||||
vars:
|
||||
- name: ansible_connect_timeout
|
||||
persistent_command_timeout:
|
||||
type: int
|
||||
description:
|
||||
|
|
|
@ -140,6 +140,8 @@ options:
|
|||
key: connect_timeout
|
||||
env:
|
||||
- name: ANSIBLE_PERSISTENT_CONNECT_TIMEOUT
|
||||
vars:
|
||||
- name: ansible_connect_timeout
|
||||
persistent_command_timeout:
|
||||
type: int
|
||||
description:
|
||||
|
|
|
@ -142,6 +142,8 @@ options:
|
|||
key: connect_timeout
|
||||
env:
|
||||
- name: ANSIBLE_PERSISTENT_CONNECT_TIMEOUT
|
||||
vars:
|
||||
- name: ansible_connect_timeout
|
||||
persistent_command_timeout:
|
||||
type: int
|
||||
description:
|
||||
|
|
Loading…
Reference in a new issue