Skip to content

Commit

Permalink
feat(aws-tools)!: Update AWS CLI to v2
Browse files Browse the repository at this point in the history
Install the latest version of the AWS CLI (v2) using an AWS maintained mechanism.

It looks like installing the AWS CLI isn't maintained by AWS as:
- It installs v1
- It is not listed on https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

Install the AWS CLI via an AWS provided zip file.
  • Loading branch information
akash1810 committed Oct 7, 2024
1 parent 103ab40 commit c701477
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions roles/aws-tools/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@
set_fact:
post_focal: "{{ 'post-focal' if ( ansible_distribution_major_version|int >= 20 ) else 'older' }}"

- name: Install pip3
apt: name=python3-pip state=present
- name: Install unzip
apt: name=unzip state=present

- name: Install latest AWS CLI
command: pip3 install awscli
- name: Create directory for AWS CLI v2
file: path=/tmp/awscliv2 state=directory

- name: Download AWS CLI v2
get_url: url=https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip dest=/tmp/awscliv2/awscliv2.zip

- name: Extract AWS CLI v2
command: unzip -o /tmp/awscliv2/awscliv2.zip -d /tmp/awscliv2

- name: Install AWS CLI v2
command: /tmp/awscliv2/aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update

- name: Install cloudformation tools
include: "{{ item }}"
Expand Down

0 comments on commit c701477

Please sign in to comment.