Skip to content

Commit

Permalink
playbook to install image on VC member id (Juniper#629)
Browse files Browse the repository at this point in the history
* playbook to install image on VC member id

* playbook to install image on VC member id

* playbook to install image on VC member id

* test playbooks
  • Loading branch information
chidanandpujar authored Oct 26, 2023
1 parent 9050a2e commit 540d40b
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
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

0 comments on commit 540d40b

Please sign in to comment.