PR to support commit check to confirm commits with JunOS (#49054)

* commit check support

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* fixed review comments

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* fixed review comments

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* fixed shippable

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
pull/45118/head
Sumit Jaiswal 6 years ago committed by GitHub
parent 8987a647e3
commit 991a9dfa12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -122,6 +122,13 @@ options:
type: bool
default: 'no'
version_added: "2.4"
check_commit:
description:
- This argument will check correctness of syntax; do not apply changes.
- Note that this argument can be used to confirm verified configuration done via commit confirmed operation
type: bool
default: 'no'
version_added: "2.8"
requirements:
- ncclient (>=v0.5.2)
notes:
@ -157,6 +164,10 @@ EXAMPLES = """
- set interfaces irb unit 10 family inet address 10.0.0.1/24
- set vlans vlan01 l3-interface irb.10
- name: Check correctness of commit configuration
junos_config:
check_commit: yes
- name: rollback the configuration to id 10
junos_config:
rollback: 10
@ -313,6 +324,7 @@ def main():
confirm=dict(default=0, type='int'),
comment=dict(default=DEFAULT_COMMENT),
confirm_commit=dict(type='bool', default=False),
check_commit=dict(type='bool', default=False),
# config operations
backup=dict(type='bool', default=False),
@ -391,6 +403,9 @@ def main():
if module._diff:
result['diff'] = {'prepared': diff}
elif module.params['check_commit']:
commit_configuration(module, check=True)
elif module.params['confirm_commit']:
with locked_config(module):
# confirm a previous commit

Loading…
Cancel
Save