2016-10-28 20:50:29 +02:00
|
|
|
---
|
2018-01-08 13:28:47 +01:00
|
|
|
- debug: msg="START netconf/netconf.yaml on connection={{ ansible_connection }}"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
- 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"
|
|
|
|
|
|
|
|
###################################
|
|
|
|
|
2017-12-14 09:18:09 +01:00
|
|
|
- name: wait for netconf server to come up
|
|
|
|
pause:
|
|
|
|
seconds: 10
|
|
|
|
|
2016-10-28 20:50:29 +02:00
|
|
|
- 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 }}"
|
2018-01-08 13:28:47 +01:00
|
|
|
connection: netconf
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
# 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-11-19 07:22:04 +01: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
|
2018-01-08 13:28:47 +01:00
|
|
|
connection: netconf
|
2016-10-28 20:50:29 +02:00
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.failed == true"
|
|
|
|
|
|
|
|
- name: re-enable netconf
|
|
|
|
junos_netconf:
|
|
|
|
state: present
|
|
|
|
register: result
|
|
|
|
|
|
|
|
|
2018-01-08 13:28:47 +01:00
|
|
|
- debug: msg="END netconf/netconfg.yaml on connection={{ ansible_connection }}"
|