system-config/playbooks/roles/install-apt-repo/tasks/main.yaml
James E. Blair b173fcb1d9 Vendor the apt repo gpg keys used for Zuul
We use several PPAs on the Zuul servers, and today the Ubuntu keyring
servers are frequently failing.  Rather than rely on them, store the
GPG keys in this repo and install the files "manually" rather than
using the apt_repo module.

Change-Id: I009a1a38d3a5864a8d5b0d8f8be24a83d1924292
2020-05-20 13:17:09 -07:00

21 lines
462 B
YAML

- name: Add apt repo key
become: yes
apt_key:
data: "{{ repo_key }}"
keyring: "/etc/apt/trusted.gpg.d/{{ repo_name }}.gpg"
- name: Add apt repo
become: yes
copy:
dest: "/etc/apt/sources.list.d/{{ repo_name }}.list"
group: root
owner: root
mode: 0644
content: "{{ repo_content }}"
register: apt_repo
- name: Run the equivalent of "apt-get update" as a separate step
apt:
update_cache: yes
when: apt_repo is changed