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
|
2018-01-12 04:16:21 +01:00
|
|
|
include: "{{ role_path }}/tests/utils/junos_command.yaml ansible_connection=netconf ansible_port=830 is_ignore_errors=false"
|
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
|
2018-01-12 04:16:21 +01:00
|
|
|
include: "{{ role_path }}/tests/utils/junos_command.yaml ansible_connection=netconf ansible_port=830 is_ignore_errors=true"
|
2016-10-28 20:50:29 +02:00
|
|
|
|
|
|
|
- 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 }}"
|