Changed 'dual_re' to 'check_commit_wait'
Instead of adding a default value of 1s the 'check_commit_wait' parameter indicates a timeout is needed between check and commit and can be set between 1 and 4s.
This commit is contained in:
Родитель
90884cb45c
Коммит
7748ebdb93
|
@ -138,12 +138,12 @@ options:
|
||||||
- Provide a confirm in minutes to the commit of the configuration
|
- Provide a confirm in minutes to the commit of the configuration
|
||||||
required: false
|
required: false
|
||||||
default: None
|
default: None
|
||||||
dual_re:
|
check_commit_wait:
|
||||||
description:
|
description:
|
||||||
- Set to yes in a Dual RE scenario when 'commit sync' is enabled in the config
|
- Set to number of seconds to wait between check and commit.
|
||||||
required: false
|
required: false
|
||||||
default: no
|
default: "0"
|
||||||
choices: ['true','false','yes','no']
|
choices: [1 - 4]
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
@ -308,8 +308,10 @@ def _load_via_netconf(module):
|
||||||
if args['confirm'] is not None:
|
if args['confirm'] is not None:
|
||||||
opts['confirm'] = args['confirm']
|
opts['confirm'] = args['confirm']
|
||||||
|
|
||||||
if args['dual_re']:
|
if int(args['check_commit_wait']) > 0:
|
||||||
time.sleep(1)
|
check_commit_wait = int(args['check_commit_wait'])
|
||||||
|
if 1 <= check_commit_wait <= 4:
|
||||||
|
time.sleep(check_commit_wait)
|
||||||
|
|
||||||
cu.commit(**opts)
|
cu.commit(**opts)
|
||||||
|
|
||||||
|
@ -413,7 +415,6 @@ def main():
|
||||||
comment=dict(required=False, default=None),
|
comment=dict(required=False, default=None),
|
||||||
port=dict(required=False, default=830),
|
port=dict(required=False, default=830),
|
||||||
confirm=dict(required=False, default=None),
|
confirm=dict(required=False, default=None),
|
||||||
dual_re=dict(required=False, type='bool', choices=BOOLEANS, default=False)
|
|
||||||
),
|
),
|
||||||
supports_check_mode=True)
|
supports_check_mode=True)
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче