summaryrefslogtreecommitdiff
path: root/roles/download-iso/tasks
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2021-01-23 20:22:31 +0200
committerzsdc <taras@vyos.io>2021-01-23 20:22:31 +0200
commit430392dc3e8385567f97f56c8107130968709227 (patch)
tree43efd26359ebd9bbc107ef7e0591e14392300508 /roles/download-iso/tasks
parent5a4bb43ad7ecdfa31f6fc2d2ddec123ac57144bd (diff)
downloadvyos-vm-images-430392dc3e8385567f97f56c8107130968709227.tar.gz
vyos-vm-images-430392dc3e8385567f97f56c8107130968709227.zip
Fixed ISO download task
The current listing of the https://downloads.vyos.io/?dir=rolling/current/amd64 is not compatible with the old parser. Also, now it is not necessary to search for the latest image anymore - it has always the same static URL. Therefore, the download page parser was removed and the download task was modified to download an ISO from a permanent URL.
Diffstat (limited to 'roles/download-iso/tasks')
-rw-r--r--roles/download-iso/tasks/main.yml33
1 files changed, 15 insertions, 18 deletions
diff --git a/roles/download-iso/tasks/main.yml b/roles/download-iso/tasks/main.yml
index dc71771..198a86b 100644
--- a/roles/download-iso/tasks/main.yml
+++ b/roles/download-iso/tasks/main.yml
@@ -1,12 +1,8 @@
-- name: get latest_iso if iso is not defined
- latest_iso:
- when: vyos_iso_url == ""
- register: latest_iso_result
-
-- name: set latest_iso as vyos_iso_url
- set_fact:
- vyos_iso_url: "{{ latest_iso_result.latest_iso }}"
- when: latest_iso_result is defined
+- name: Download VyOS ISO release
+ get_url:
+ url: "{{ vyos_iso_url }}"
+ dest: "{{ vyos_iso_local }}"
+ force: no
- name: Fetch VyOS ISO GPG signature
uri:
@@ -14,25 +10,26 @@
dest: "{{ vyos_iso_local }}.asc"
status_code: 200,404,403
tags: verify
- register: gpg_uri
-
-- name: Download VyOS ISO release
- get_url:
- url: "{{ vyos_iso_url }}"
- dest: "{{ vyos_iso_local }}"
+ register: gpg_uri_iso
- name: Fetch the VyOS release GPG key
- get_url:
+ uri:
url: "{{ vyos_key_url}}"
dest: "{{ vyos_key_local }}"
+ status_code: 200,404,403
tags: verify
+ register: gpg_uri_release_key
- name: Install the VyOS release GPG key
command: gpg --import {{ vyos_key_local }}
- when: gpg_uri.status == 200
+ when:
+ - gpg_uri_iso.status == 200
+ - gpg_uri_release_key.status == 200
tags: verify
- name: Validate ISO GPG signature
command: gpg --verify {{ vyos_iso_local }}.asc {{ vyos_iso_local }}
- when: gpg_uri.status == 200
+ when:
+ - gpg_uri_iso.status == 200
+ - gpg_uri_release_key.status == 200
tags: verify