forked from Juniper/ansible-junos-stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
playbook to install image on VC member id (Juniper#629)
* 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
1 parent
9050a2e
commit 540d40b
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |