diff options
Diffstat (limited to 'roles/installer/ubuntu')
-rw-r--r-- | roles/installer/ubuntu/fetch/tasks/determine-latest-version.yml | 10 | ||||
-rw-r--r-- | roles/installer/ubuntu/fetch/tasks/fetch-latest.yml | 13 | ||||
-rw-r--r-- | roles/installer/ubuntu/fetch/tasks/find-location.yml (renamed from roles/installer/ubuntu/fetch/tasks/fetch-version.yml) | 8 | ||||
-rw-r--r-- | roles/installer/ubuntu/fetch/tasks/main.yml | 6 | ||||
-rw-r--r-- | roles/installer/ubuntu/fetch/vars/main.yml | 2 |
5 files changed, 20 insertions, 19 deletions
diff --git a/roles/installer/ubuntu/fetch/tasks/determine-latest-version.yml b/roles/installer/ubuntu/fetch/tasks/determine-latest-version.yml new file mode 100644 index 00000000..0b8cf3f9 --- /dev/null +++ b/roles/installer/ubuntu/fetch/tasks/determine-latest-version.yml @@ -0,0 +1,10 @@ +--- +- name: downloading SHA256SUMS file for latest release + uri: + url: "https://releases.ubuntu.com/{{ ubuntu_installer_codename }}/SHA256SUMS" + return_content: yes + register: ubuntu_installer_latest_sha256sums + +- name: set version to the latest release + set_fact: + ubuntu_installer_version: "{{ ubuntu_installer_latest_sha256sums.content | regex_search('ubuntu-([0-9.]+)-'+ubuntu_installer_variant+'-'+ubuntu_installer_arch+'.iso', '\\1') | first }}" diff --git a/roles/installer/ubuntu/fetch/tasks/fetch-latest.yml b/roles/installer/ubuntu/fetch/tasks/fetch-latest.yml deleted file mode 100644 index 9baa6d97..00000000 --- a/roles/installer/ubuntu/fetch/tasks/fetch-latest.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: downloading SHA256SUMS and signature file for latest release - loop: - - SHA256SUMS - - SHA256SUMS.gpg - get_url: - url: "https://releases.ubuntu.com/{{ ubuntu_installer_codename }}/{{ item }}" - dest: "{{ ubuntu_installer_target_dir }}/{{ item }}" - force: "{{ ubuntu_installer_force_download }}" - -- name: set download url to releases.ubuntu.com - set_fact: - ubuntu_installer_base_url: "https://releases.ubuntu.com/{{ ubuntu_installer_codename }}" diff --git a/roles/installer/ubuntu/fetch/tasks/fetch-version.yml b/roles/installer/ubuntu/fetch/tasks/find-location.yml index 868adc95..752eebe1 100644 --- a/roles/installer/ubuntu/fetch/tasks/fetch-version.yml +++ b/roles/installer/ubuntu/fetch/tasks/find-location.yml @@ -6,7 +6,7 @@ - SHA256SUMS - SHA256SUMS.gpg get_url: - url: "https://old-releases.ubuntu.com/releases/{{ ubuntu_installer_version }}/{{ item }}" + url: "https://old-releases.ubuntu.com/releases/{{ ubuntu_installer_codename }}/{{ item }}" dest: "{{ ubuntu_installer_target_dir }}/{{ item }}" force: yes register: ubuntu_installer_old @@ -23,7 +23,7 @@ - name: set download url to old-releases.ubuntu.com when: (ubuntu_installer_old_sha256sum.stdout_lines | length) > 0 set_fact: - ubuntu_installer_base_url: "https://old-releases.ubuntu.com/releases/{{ ubuntu_installer_version }}" + ubuntu_installer_base_url: "https://old-releases.ubuntu.com/releases/{{ ubuntu_installer_codename }}" - when: ubuntu_installer_base_url is not defined block: @@ -32,10 +32,10 @@ - SHA256SUMS - SHA256SUMS.gpg get_url: - url: "https://releases.ubuntu.com/{{ ubuntu_installer_version }}/{{ item }}" + url: "https://releases.ubuntu.com/{{ ubuntu_installer_codename }}/{{ item }}" dest: "{{ ubuntu_installer_target_dir }}/{{ item }}" force: yes - name: set download url to releases.ubuntu.com set_fact: - ubuntu_installer_base_url: "https://releases.ubuntu.com/{{ ubuntu_installer_version }}" + ubuntu_installer_base_url: "https://releases.ubuntu.com/{{ ubuntu_installer_codename }}" diff --git a/roles/installer/ubuntu/fetch/tasks/main.yml b/roles/installer/ubuntu/fetch/tasks/main.yml index 618cfd22..a4f7f720 100644 --- a/roles/installer/ubuntu/fetch/tasks/main.yml +++ b/roles/installer/ubuntu/fetch/tasks/main.yml @@ -1,10 +1,14 @@ --- +- when: ubuntu_installer_version is undefined + include_tasks: determine-latest-version.yml + - name: prepare directories for installer files file: name: "{{ ubuntu_installer_target_dir }}" state: directory -- include_tasks: "fetch-{{ (ubuntu_installer_version is defined) | ternary('version', 'latest') }}.yml" +- name: find download location for release version + import_tasks: find-location.yml - name: verfiy signature of SHA256SUMS file command: >- diff --git a/roles/installer/ubuntu/fetch/vars/main.yml b/roles/installer/ubuntu/fetch/vars/main.yml index caf1fa67..29ca94a6 100644 --- a/roles/installer/ubuntu/fetch/vars/main.yml +++ b/roles/installer/ubuntu/fetch/vars/main.yml @@ -1,2 +1,2 @@ --- -ubuntu_installer_target_dir: "{{ installer_base_path }}/{{ ubuntu_installer_codename }}/{{ ubuntu_installer_version | default('latest') }}-{{ ubuntu_installer_variant }}" +ubuntu_installer_target_dir: "{{ installer_base_path }}/{{ ubuntu_installer_codename }}/{{ ubuntu_installer_version }}-{{ ubuntu_installer_variant }}" |