mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-24 13:04:00 -07:00
Implementation of junos_static_route module (#26501)
* Implementation of junos_static_route module * junos implementation of net_static_route * integration test for junos_static_route * integration test for junos net_static_route * Minor change * Doc change * Fix CI issue
This commit is contained in:
parent
63f4aa3069
commit
ba60ac04fc
10 changed files with 479 additions and 1 deletions
|
|
@ -0,0 +1,71 @@
|
|||
---
|
||||
- debug: msg="START net_static_route junos/basic.yaml"
|
||||
|
||||
- name: setup - remove static route
|
||||
net_static_route:
|
||||
address: 1.1.1.0/24
|
||||
state: absent
|
||||
provider: "{{ netconf }}"
|
||||
|
||||
- name: Confgiure static route
|
||||
net_static_route:
|
||||
prefix: 1.1.1.0/24
|
||||
next_hop: 3.3.3.3
|
||||
admin_distance: 10
|
||||
state: present
|
||||
provider: "{{ netconf }}"
|
||||
register: result
|
||||
|
||||
- name: Get running configuration
|
||||
junos_rpc:
|
||||
rpc: get-configuration
|
||||
provider: "{{ netconf }}"
|
||||
register: config
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "'<name>1.1.1.0/24</name>' in config.xml"
|
||||
- "'<next-hop>3.3.3.3</next-hop>' in config.xml"
|
||||
|
||||
- name: Confgiure static route (idempotent)
|
||||
net_static_route:
|
||||
prefix: 1.1.1.0/24
|
||||
next_hop: 3.3.3.3
|
||||
admin_distance: 10
|
||||
state: present
|
||||
provider: "{{ netconf }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
|
||||
- name: Delete static route
|
||||
net_static_route:
|
||||
prefix: 1.1.1.0/24
|
||||
state: absent
|
||||
provider: "{{ netconf }}"
|
||||
register: result
|
||||
|
||||
- name: Get running configuration
|
||||
junos_rpc:
|
||||
rpc: get-configuration
|
||||
provider: "{{ netconf }}"
|
||||
register: config
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "'<name>1.1.1.0/24</name>' not in config.xml"
|
||||
|
||||
- name: Delete static route (idempotent)
|
||||
net_static_route:
|
||||
prefix: 1.1.1.0/24
|
||||
state: absent
|
||||
provider: "{{ netconf }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
- include: "{{ role_path }}/tests/junos/basic.yaml"
|
||||
when: hostvars[inventory_hostname]['ansible_network_os'] == 'junos'
|
||||
Loading…
Add table
Add a link
Reference in a new issue