Clark Boylan 33c2b4ff5f Ensure /etc/apt/sources.list.d exists
Jammy nodes appear to lack the /etc/apt/sources.list.d dir by default.
Ensure it exists in the install-docker role before we attempt to
install a deb repo config to that directory for docker packages.

Change-Id: I859d31ed116607ffa3d8db5bfd0b805d72dd70c0
2022-08-04 13:40:35 +10:00

41 lines
782 B
YAML

- name: Install pre-reqs
package:
name: "{{ item }}"
state: present
with_items:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
become: yes
- name: Add docker GPG key
become: yes
apt_key:
data: "{{ ubuntu_gpg_key }}"
- name: Ensure /etc/apt/sources.list.d exists
file:
path: /etc/apt/sources.list.d
state: directory
owner: root
group: root
mode: '0755'
# TODO(mordred) We should add a proxy cache mirror for this
- name: Add docker apt repo
become: yes
template:
dest: /etc/apt/sources.list.d/docker.list
group: root
mode: 0644
owner: root
src: sources.list.j2
- name: Install docker
become: yes
apt:
name: docker-ce
state: present
update_cache: yes