2016-10-28 20:50:29 +02: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 17:45:00 +01:00
|
|
|
junos_command:
|
|
|
|
rpcs: get-software-information
|
2016-10-28 20:50:29 +02: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 17:45:00 +01:00
|
|
|
- name: wait for persistent socket to timeout
|
|
|
|
pause:
|
2017-09-22 13:12:16 +02:00
|
|
|
seconds: 120
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
- name: Ensure we can NOT talk via netconf
|
2017-03-12 17:45:00 +01:00
|
|
|
junos_command:
|
|
|
|
rpcs: get-software-information
|
2016-10-28 20:50:29 +02:00
|
|
|
provider: "{{ netconf }}"
|
|
|
|
register: result
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.failed == true"
|
2017-08-01 18:03:11 +02:00
|
|
|
- "'unable to open shell' in result.msg"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
- name: re-enable netconf
|
|
|
|
junos_netconf:
|
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
|
|
|
|
|
|
|
|
- debug: msg="END netconf/netconfg.yaml"
|