diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..5282c7c --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,4 @@ +--- +- name: Update the package cache + ansible.builtin.package: + update_cache: true diff --git a/meta/main.yml b/meta/main.yml index f01fa42..d963b7f 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -18,7 +18,10 @@ galaxy_info: # OS family. This simplifies a lot of things for roles that support # Kali Linux, so it makes sense to force the installation of Ansible # 2.10 or newer. - min_ansible_version: "2.10" + # + # We use ansible.builtin.deb822_repository in this role (for + # Ubuntu), and this module was introduced in ansible-core 2.15. + min_ansible_version: "2.15" namespace: cisagov platforms: - name: Amazon Linux diff --git a/tasks/install_Debian.yml b/tasks/install_Debian.yml index 10b19b4..4495cbd 100644 --- a/tasks/install_Debian.yml +++ b/tasks/install_Debian.yml @@ -3,8 +3,8 @@ ansible.builtin.include_tasks: install_common.yml - name: >- - Build deb packages from the aws/efs-utils code (Debian post-Bullseye, - Kali, and Ubuntu) + Build deb packages from the aws/efs-utils code (Debian post-Bullseye and + Kali) # A dependency of aws/efs-utils (aws/aws-lc-rs) can only be built # using gcc<=13. This is the reason for the params below. See here # for more details: diff --git a/tasks/install_Ubuntu.yml b/tasks/install_Ubuntu.yml new file mode 100644 index 0000000..f0ac871 --- /dev/null +++ b/tasks/install_Ubuntu.yml @@ -0,0 +1,32 @@ +--- +- name: Add official aws/efs-utils repo + block: + - name: Install prerequisites so apt can use DEB822 repos + ansible.builtin.package: + name: + - python3-debian + + - name: Add the official aws/efs-utils repo + ansible.builtin.deb822_repository: + components: + - main + name: efs-utils + signed_by: https://amazon-efs-utils.aws.com/efs-utils-armored.gpg + suites: + - "{{ ansible_facts['distribution_version'] }}" + uris: + - >- + https://amazon-efs-utils.aws.com/repo/deb/ubuntu/{{ + ansible_facts['distribution_version'] }} + notify: + - Update the package cache + + # We need the handler that updates the apt package cache to run + # now if it is necessary. + - name: Flush handlers + ansible.builtin.meta: flush_handlers + +- name: Install amazon-efs-utils + ansible.builtin.package: + name: + - amazon-efs-utils diff --git a/vars/Ubuntu_jammy.yml b/vars/Ubuntu_jammy.yml deleted file mode 100644 index 09b1c30..0000000 --- a/vars/Ubuntu_jammy.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -# The version of gcc to use when building aws/efs-utils on this -# platform. aws/efs-utils requires gcc<=13, so we use the latest -# version of gcc that is <=13 but available on the platform. -gcc_version: 11 - -# The system packages to install. See here for more details: -# https://github.com/aws/efs-utils/blob/v2.4.2/INSTALL.md -package_names: - - binutils - - cargo - - cmake - - gcc-{{ gcc_version }} - - g++-{{ gcc_version }} - - gettext-base - - golang - - libssl-dev - - make - - pkgconf - -# The version of amazon-efs-utils to install. -version: 2.4.2