Skip to content

Commit

Permalink
Update installation to be more fine-grained
Browse files Browse the repository at this point in the history
Install different prerequisites and tagged version of the amazon/efs-utils
package depending on the host. This will allow hosts that support the
Rust toolchain v1.65+ to use efs-utils v2 while hosts with an older
version of the Rust toolchain are held back on the last v1 release.
  • Loading branch information
mcdonnnj committed Apr 16, 2024
1 parent 9876e79 commit aee0660
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 13 deletions.
7 changes: 1 addition & 6 deletions tasks/install_Debian.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
---
- name: Install amazon-efs-utils prerequisites
ansible.builtin.package:
name:
- binutils
- cargo
- libssl-dev
- pkg-config
- rustc
name: "{{ amazon_efs_utils_prerequisities }}"

- name: Load tasks file with common install tasks
ansible.builtin.include_tasks: install_common.yml
Expand Down
7 changes: 1 addition & 6 deletions tasks/install_RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
---
- name: Install amazon-efs-utils prerequisites
ansible.builtin.package:
name:
- cargo
- make
- openssl-devel
- rpm-build
- rust
name: "{{ amazon_efs_utils_prerequisities }}"

- name: Load tasks file with common install tasks
ansible.builtin.include_tasks: install_common.yml
Expand Down
2 changes: 1 addition & 1 deletion tasks/install_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

- name: Download a tarball of the aws/efs-utils repository
ansible.builtin.unarchive:
src: https://github.com/aws/efs-utils/tarball/master
src: https://github.com/aws/efs-utils/tarball/refs/tags/{{ amazon_efs_utils_repository_tag }}
dest: /tmp/efs-utils
remote_src: true
extra_opts:
Expand Down
11 changes: 11 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
---
- name: Load variables file with appropriate values based on the OS type
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_distribution }}_{{ ansible_distribution_release }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
paths:
- "{{ role_path }}/vars"

- name: Load tasks file with install tasks based on the OS type
ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}"
vars:
Expand Down
3 changes: 3 additions & 0 deletions vars/Amazon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
# No variables are declared for Aamazon Linux 2023 because efs-utils is available
# for installation from the package manager.
8 changes: 8 additions & 0 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
amazon_efs_utils_prerequisities:
- make
- binutils

# Ubuntu and Debian versions older than Trixie (current testing) do not have a
# new enough version of the Rust toolchain to build v2 of the efs-utils package.
amazon_efs_utils_repository_tag: v1.36.0
9 changes: 9 additions & 0 deletions vars/Debian_trixie.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
amazon_efs_utils_prerequisities:
- binutils
- cargo
- libssl-dev
- pkg-config
- rustc

amazon_efs_utils_repository_tag: v2.0.0
1 change: 1 addition & 0 deletions vars/Kali.yml
9 changes: 9 additions & 0 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
amazon_efs_utils_prerequisities:
- cargo
- make
- openssl-devel
- rpm-build
- rust

amazon_efs_utils_repository_tag: v2.0.0
1 change: 1 addition & 0 deletions vars/Ubuntu.yml

0 comments on commit aee0660

Please sign in to comment.