@ -4,9 +4,9 @@
- name : Setup
- name : Setup
junos_netconf:
junos_netconf:
state : present
state : present
register : result
###################################
###################################
- name : Change port
- name : Change port
junos_netconf:
junos_netconf:
state : present
state : present
@ -27,17 +27,24 @@
that:
that:
- "result.changed == false"
- "result.changed == false"
- name : wait for netconf server to come up
- name : wait for netconf port tcp/8022 to be open
pause:
wait_for:
seconds : 10
host : "{{ hostvars[item].ansible_host }}"
port : 8022
with_inventory_hostnames : junos
- name : Reset ansible connections
meta : reset_connection
- name : Ensure we can communicate over 8022
- name : Ensure we can communicate over 8022
include : "{{ role_path }}/tests/utils/junos_command.yaml ansible_connection=netconf ansible_port=8022 is_ignore_errors=false"
include : "{{ role_path }}/tests/utils/junos_command.yaml ansible_connection=netconf ansible_port=8022 is_ignore_errors=false"
- name : wait for persistent socket to timeout
- name : wait for netconf port tcp/830 to be closed
pause:
wait_for:
seconds : 120
host : "{{ hostvars[item].ansible_host }}"
port : 830
state : stopped
with_inventory_hostnames : junos
# This protects against the port override above not being honoured and a bug setting the port
# 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
- name : Ensure we can NOT communicate over default port
@ -50,11 +57,15 @@
- name : Set back netconf to default port
- name : Set back netconf to default port
junos_netconf:
junos_netconf:
state : present
state : present
register : result
- name : wait for persistent socket to timeout
- name : wait for netconf port tcp/830 to be open
pause:
wait_for:
seconds : 120
host : "{{ hostvars[item].ansible_host }}"
port : 830
with_inventory_hostnames : junos
- name : Reset ansible connections
meta : reset_connection
- name : Ensure we can communicate over netconf
- name : Ensure we can communicate over netconf
include : "{{ role_path }}/tests/utils/junos_command.yaml ansible_connection=netconf ansible_port=830 is_ignore_errors=false"
include : "{{ role_path }}/tests/utils/junos_command.yaml ansible_connection=netconf ansible_port=830 is_ignore_errors=false"