DCD-686: Initial manifest download logic.

This commit is contained in:
Steve Smith
2019-10-03 11:24:31 +10:00
parent 6bd58d54f5
commit 58632c27f9
6 changed files with 93 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
---
- block:
- name: Parse the manifest URL
set_fact:
atl_backup_manifest_scheme: "{{ atl_backup_manifest_url | urlsplit('scheme') }}"
atl_backup_manifest_bucket: "{{ atl_backup_manifest_url | urlsplit('hostname') }}"
atl_backup_manifest_path: "{{ atl_backup_manifest_url | urlsplit('path') }}"
atl_backup_manifest_filename: "{{ atl_backup_manifest_path | basename}}"
atl_backup_manifest_dest: "{{ atl_installer_temp }}/{{ atl_backup_manifest_filename }}"
- name: Fetch the manifest from S3
aws_s3:
bucket: "{{ atl_backup_manifest | urlsplit('hostname' }}"
object: "{{ atl_backup_manifest | urlsplit('path' }}"
dest: "{{ atl_installer_temp }}/{{ atl_backup_manifest | urlsplit('path' | }}"
when: atl_backup_manifest_scheme == 's3'
- name: Fetch the manifest from remote host
get_url:
url: "{{ atl_backup_manifest_url }}"
dest: "{{ atl_backup_manifest_dest }}"
when: atl_backup_manifest_scheme != 's3'
when: atl_backup_manifest_url is defined and atl_backup_manifest_url != ''