-
Notifications
You must be signed in to change notification settings - Fork 708
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor neighbor VM image downloading
The original design assumes downloading neighbor VM images from azure storage using SAS key if image file is not found on local testbed server. Since SAS key is considered as a credential, the design introduces complexity of managing SAS keys securely. This change refactored the design to download image files from simple HTTP server. URL of the image files can be specified in variable files under `ansible/group_vars/vm_host`. Signed-off-by: Xin Wang <[email protected]>
- Loading branch information
Showing
14 changed files
with
278 additions
and
103 deletions.
There are no files selected for viewing
File renamed without changes.
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
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,10 @@ | ||
vcisco_image_filename: vIOS-xrv9k-goldenk9-x-7.3.4-20.qcow2 | ||
skip_vcisco_image_downloading: false | ||
|
||
# Please update url to the actual URL of the image file in your environment. If the image file | ||
# is not available on test server, the file will be downloaded from the URLs. | ||
# The url can be a string as single URL or a list of strings as multiple URLs. If it is a list, the code | ||
# logic will automatically try each URL in the list | ||
vcisco_image_url: | ||
- http://example1.com/vIOS-xrv9k-goldenk9-x-7.3.4-20.qcow2 | ||
- http://example2.com/vIOS-xrv9k-goldenk9-x-7.3.4-20.qcow2 |
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,20 @@ | ||
# Two image files required for vEOS VMs: | ||
# 1. cd file. | ||
# 2. hdd file. | ||
veos_cd_image_filename: Aboot-veos-serial-8.0.0.iso | ||
veos_hdd_image_filename: vEOS-lab-4.20.15M.vmdk | ||
|
||
# Please update url to the actual URL of the veos image files in your environment. If the image files | ||
# are not available on test server, the files will be downloaded from the URLs. | ||
# The url can be a string as single URL or a list of strings as multiple URLs. If it is a list, the code | ||
# logic will automatically try each URL in the list | ||
veos_cd_image_url: | ||
- http://example1.com/Aboot-veos-serial-8.0.0.iso | ||
- http://example2.com/Aboot-veos-serial-8.0.0.iso | ||
veos_hdd_image_url: | ||
- http://example1.com/vEOS-lab-4.20.15M.vmdk | ||
- http://example2.com/vEOS-lab-4.20.15M.vmdk | ||
|
||
# If the variable is set to true, the code logic will not try to download the image files from the URLs when the files | ||
# are not available on test server | ||
skip_veos_image_downloading: false |
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,10 @@ | ||
vsonic_image_filename: sonic-vs.img | ||
skip_vsonic_image_downloading: false | ||
|
||
# Please update url to the actual URL of the image file in your environment. If the image file | ||
# is not available on test server, the file will be downloaded from the URLs. | ||
# The url can be a string as single URL or a list of strings as multiple URLs. If it is a list, the code | ||
# logic will automatically try each URL in the list | ||
vsonic_image_url: | ||
- http://example1.com/sonic-vs.img | ||
- http://example2.com/sonic-vs.img |
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
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
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
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
- name: Probe if the URL works | ||
uri: | ||
url: "{{ item }}" | ||
method: HEAD | ||
status_code: 200 | ||
return_content: no | ||
timeout: 3 | ||
environment: "{{ proxy_env | default({}) }}" | ||
register: image_url_probe_result | ||
failed_when: false | ||
|
||
- name: Append working URL to working_image_urls list | ||
set_fact: | ||
working_image_urls: "{{ working_image_urls + [ item ] }}" | ||
when: image_url_probe_result.status == 200 |
Oops, something went wrong.