From: Thanh Ha Date: Fri, 14 Aug 2020 17:29:30 +0000 (-0400) Subject: Do not install Ansible PPA on Ubuntu 20.04 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F00%2F65100%2F3;p=ansible%2Froles%2Flf-recommended-tools.git Do not install Ansible PPA on Ubuntu 20.04 Unfortunately the Ansible PPA is not yet available on Ubuntu 20.04 so do not install it. Also add a TODO note to go back and figure out if we really still need the PPA. This was added because we wanted to get a more recent version of Ansible on Ubuntu 16.04 but perhaps the distro packaged version is sufficient with newer Ubuntu versions. Ref: https://github.com/ansible/ansible/pull/69161 Signed-off-by: Thanh Ha Change-Id: I7a02a6e0e95b148c640dfd41f3ea3d50dfff17d9 --- diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 572361f..0d1e519 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -12,6 +12,10 @@ platforms: image: centos:7 - name: ubuntu1604 image: ubuntu:16.04 + - name: ubuntu1804 + image: ubuntu:18.04 + - name: ubuntu2004 + image: ubuntu:20.04 provisioner: name: ansible scenario: diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index 96d1571..cbdf698 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -3,6 +3,11 @@ hosts: all gather_facts: true tasks: + - name: Update APT cache + apt: + update_cache: yes + when: ansible_distribution == 'Ubuntu' + become: true - name: Install EPEL repository yum: name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm diff --git a/tasks/main.yml b/tasks/main.yml index 533a294..fec45d9 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -7,9 +7,19 @@ - "{{ ansible_os_family }}.yaml" - name: Setup Ansible PPA - apt_repository: - repo: ppa:ansible/ansible - when: ansible_distribution == 'Ubuntu' + block: + # gnupg2 is required to install the PPA and is missing on Ubuntu 18.04 + - name: Install gnupg2 + apt: + name: gnupg2 + state: present + - name: Setup Ansible PPA + apt_repository: + repo: ppa:ansible/ansible + # Ubuntu 20.04 PPA is not yet available so skip installing it for now. + # TODO: Figure out if recent versions of Ansible in Ubuntu is sufficient for + #. our use without the need to pull in from PPA. + when: ansible_distribution == 'Ubuntu' and ansible_facts['distribution_major_version'] is version('20', '<') become: true - name: Install LF Recommended Tools