Skip to content

Commit

Permalink
#823 No change in some downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
fketelaars committed Dec 10, 2024
1 parent b939a5e commit a72cc83
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 43 deletions.
68 changes: 34 additions & 34 deletions automation-roles/99-generic/aws/aws-download-cli/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
---
- name: Validate mandatory variables are defined
assert:
that:
- cloud_platform is defined
- name: Validate mandatory variables are defined
assert:
that:
- cloud_platform is defined

- name: Validate cloud_platform is implemented
fail: msg="cloud_platform {{ cloud_platform }} is not implemented, current implemented cloud platforms are {{ implemented_cloud_platform_types }} "
when: "cloud_platform not in implemented_cloud_platform_types"
- name: Validate cloud_platform is implemented
fail: msg="cloud_platform {{ cloud_platform }} is not implemented, current implemented cloud platforms are {{ implemented_cloud_platform_types }} "
when: "cloud_platform not in implemented_cloud_platform_types"

- name: Create downloads directory
file:
path: "{{ status_dir }}/downloads"
state: directory
- name: Create downloads directory
file:
path: "{{ status_dir }}/downloads"
state: directory

- name: Check if AWS client was already downloaded
stat:
path: "{{ status_dir }}/downloads/{{ _aws_cli_package }}"
register: _aws_cli_download
- name: Check if AWS client was already downloaded
stat:
path: "{{ status_dir }}/downloads/{{ _aws_cli_package }}"
register: _aws_cli_download

- name: Download AWS CLI "{{ _aws_cli_url }}"
get_url:
url: "{{ _aws_cli_url }}"
dest: "{{ status_dir }}/downloads/{{ _aws_cli_package }}"
owner: root
mode: 0644
register: _download_result
until: _download_result is succeeded
retries: 5
delay: 30
when: not _aws_cli_download.stat.exists
- name: Download AWS CLI "{{ _aws_cli_url }}"
get_url:
url: "{{ _aws_cli_url }}"
dest: "{{ status_dir }}/downloads/{{ _aws_cli_package }}"
owner: root
mode: 0644
register: _download_result
until: _download_result is succeeded
retries: 5
delay: 30
when: not _aws_cli_download.stat.exists

- name: Unpack aws-cli client installer
unarchive:
src: "{{ status_dir }}/downloads/{{ _aws_cli_package }}"
dest: "{{ status_dir }}/downloads"
remote_src: True
- name: Unpack aws-cli client installer
unarchive:
src: "{{ status_dir }}/downloads/{{ _aws_cli_package }}"
dest: "{{ status_dir }}/downloads"
remote_src: True

- name: Install aws client
shell: |
{{ status_dir }}/downloads/aws/install
- name: Install aws client
shell: |
{{ status_dir }}/downloads/aws/install
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
when: not _rosa_download.stat.exists

- name: Unpack ROSA client
shell: tar -zvxf {{ status_dir }}/downloads/{{ _rosa_client_package }} -C /usr/local/bin --no-same-owner
shell:
tar -zvxf {{ status_dir }}/downloads/{{ _rosa_client_package }} -C /usr/local/bin --no-same-owner
args:
warn: false

Expand All @@ -48,4 +49,4 @@

- name: Show ROSA client version
debug:
var: _rosa_client_version.stdout
var: _rosa_client_version.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
state: directory

- set_fact:
_cloudctl_arch: "amd64"
_cloudctl_arch: 'amd64'
- set_fact:
_cloudctl_arch: "{{ ARCH }}"
_cloudctl_arch: '{{ ARCH }}'
when: ARCH != 'x86_64'

- name: Check if cloudctl was already downloaded
Expand All @@ -16,11 +16,12 @@
register: _cloudctl_download

- block:
- include_tasks: cloudctl-download.yml
when: (_github_ibm_pat | default('')) == ''

- include_tasks: cloudctl-download-github-pat.yml
when: (_github_ibm_pat | default('')) != ''
- include_tasks: cloudctl-download.yml
when: (_github_ibm_pat | default('')) == ''

- include_tasks: cloudctl-download-github-pat.yml
when: (_github_ibm_pat | default('')) != ''

when: not _cloudctl_download.stat.exists

Expand All @@ -40,4 +41,4 @@

- name: Show cloudctl version
debug:
var: _cloudctl_version.stdout
var: _cloudctl_version.stdout

0 comments on commit a72cc83

Please sign in to comment.