Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tests/pb.juniper_junos_persistent_conn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
- name: Test juniper.device.rpc module
hosts: all
connection: juniper.device.pyez
gather_facts: no
collections:
- juniper.device

tasks:
#################
- name: Get Device Configuration with filter and attr
rpc:
rpc: get-config
format: xml
filter: <configuration><groups><name>re0</name></groups></configuration>
attr: name=re0
register: test7
ignore_errors: True
tags: [ test7 ]

- name: Check TEST 7
assert:
that:
- test7.msg == "The \"get-config\" RPC executed successfully."
tags: [ test7 ]
43 changes: 43 additions & 0 deletions tests/pb.juniper_junos_software_member.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
- name: Test juniper.device.software module
hosts: all
collections:
- juniper.device
connection: local
gather_facts: no
vars:
wait_time: 3600
pkg_dir: /var/tmp/
OS_version: 22.4
OS_package: junos-install-ex-x86-64-22.4I62500TB237700_cd-builder.tgz
log_dir: /var/log/

tasks:
- name: Checking NETCONF connectivity
wait_for: host={{ ansible_ssh_host }} port=830 timeout=5
- name: Install Junos OS package on VC member
software:
reboot: False
no_copy: True
version: "{{ OS_version }}"
package: "{{ pkg_dir }}/{{ OS_package }}"
logfile: "{{ log_dir }}/software.log"
all_re: False
member_id: ['1','2']
register: test1
notify:
- wait_reboot

- name: Print response
debug:
var: test1

- name: Check TEST - 1
assert:
that:
- test1.failed == false

handlers:
- name: wait_reboot
wait_for: host={{ ansible_ssh_host }} port=830 timeout={{ wait_time }}
when: not test1.check_mode