roll up of fixes and updates for junos modules (#22543)

* removes cli functions
* adds comment and confirm to arguments
* implements zeroize argument
* fixes get_diff function in junos shared lib to return diff
* lots of minor bug fixes in junos_config
* minor syntax fixes in junos_netconf
* updates netconf integration tests
This commit is contained in:
Peter Sprygada 2017-03-12 11:45:00 -05:00 committed by GitHub
commit 2b2072a8c9
6 changed files with 86 additions and 92 deletions

View file

@ -17,8 +17,6 @@
- assert:
that:
- "result.changed == true"
# https://github.com/ansible/ansible-modules-core/issues/4807
- "result.updates is not defined"
- name: check device with config
junos_config:
@ -29,7 +27,5 @@
- assert:
that:
- "result.changed == false"
# https://github.com/ansible/ansible-modules-core/issues/4807
- "result.updates is not defined"
- debug: msg="END netconf/src_basic.yaml"

View file

@ -33,17 +33,15 @@
- "result.changed == false"
- name: Ensure we can communicate over 8080
junos_config:
lines:
- set system host-name {{ inventory_hostname_short }}
junos_command:
rpcs: get-software-information
provider: "{{ netconf }}"
port: 8080
# This protects against the port override above not being honoured and a bug setting the port
- name: Ensure we can NOT communicate over default port
junos_config:
lines:
- set system host-name {{ inventory_hostname_short }}
junos_command:
rpcs: get-software-information
provider: "{{ netconf }}"
register: result
ignore_errors: true
@ -60,9 +58,8 @@
register: result
- name: Ensure we can communicate over netconf
junos_config:
lines:
- set system host-name {{ inventory_hostname_short }}
junos_command:
rpcs: get-software-information
provider: "{{ netconf }}"
- debug: msg="END netconf/changeport.yaml"

View file

@ -21,9 +21,8 @@
###################################
- name: Ensure we can communicate over netconf
junos_config:
lines:
- set system host-name {{ inventory_hostname_short }}
junos_command:
rpcs: get-software-information
provider: "{{ netconf }}"
# Disable netconf
@ -48,11 +47,13 @@
that:
- "result.changed == false"
- name: wait for persistent socket to timeout
pause:
seconds: 30
- name: Ensure we can NOT talk via netconf
junos_config:
lines:
- set system host-name {{ inventory_hostname_short }}
junos_command:
rpcs: get-software-information
provider: "{{ netconf }}"
register: result
ignore_errors: true