2016-10-28 18:50:29 +00:00
|
|
|
---
|
|
|
|
- debug: msg="START netconf/netconf.yaml"
|
|
|
|
|
|
|
|
|
|
|
|
- name: Ensure netconf is enabled
|
|
|
|
junos_netconf:
|
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- name: idempotent tests
|
|
|
|
junos_netconf:
|
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
###################################
|
|
|
|
|
|
|
|
- name: Ensure we can communicate over netconf
|
2017-03-12 16:45:00 +00:00
|
|
|
junos_command:
|
|
|
|
rpcs: get-software-information
|
2016-10-28 18:50:29 +00:00
|
|
|
provider: "{{ netconf }}"
|
|
|
|
|
|
|
|
# Disable netconf
|
|
|
|
|
|
|
|
- name: Disable netconf
|
|
|
|
junos_netconf:
|
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: idempotent tests
|
|
|
|
junos_netconf:
|
|
|
|
state: absent
|
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2017-03-12 16:45:00 +00:00
|
|
|
- name: wait for persistent socket to timeout
|
|
|
|
pause:
|
2017-11-07 06:11:51 +00:00
|
|
|
seconds: 150
|
2016-10-28 18:50:29 +00:00
|
|
|
|
|
|
|
- name: Ensure we can NOT talk via netconf
|
2017-03-12 16:45:00 +00:00
|
|
|
junos_command:
|
|
|
|
rpcs: get-software-information
|
2016-10-28 18:50:29 +00:00
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.failed == true"
|
2017-08-01 16:03:11 +00:00
|
|
|
- "'unable to open shell' in result.msg"
|
2016-10-28 18:50:29 +00:00
|
|
|
|
|
|
|
- name: re-enable netconf
|
|
|
|
junos_netconf:
|
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
|
|
|
|
|
|
|
|
- debug: msg="END netconf/netconfg.yaml"
|