docker: use uumas.general.apt_repository for apt repo

This commit is contained in:
uumas
2023-07-14 15:25:26 +03:00
parent 2fae11dd33
commit 1596b2bfc5
2 changed files with 17 additions and 29 deletions

View File

@@ -8,6 +8,6 @@ readme: README.md
repository: https://git.uumas.fi/uumas/ansible-docker repository: https://git.uumas.fi/uumas/ansible-docker
license_file: LICENSE license_file: LICENSE
dependencies: dependencies:
uumas.general: '>=0.5.8' uumas.general: '>=0.5.9'
authors: authors:
- uumas - uumas

View File

@@ -1,33 +1,15 @@
--- ---
- name: Install dependencies - name: Add docker apt repository
apt: ansible.builtin.import_role:
name: name: uumas.general.apt_repository
- apt-transport-https vars:
- ca-certificates repo_name: docker
- curl repo_url: https://download.docker.com/linux/{{ ansible_distribution | lower }}
- gnupg repo_key_url: https://download.docker.com/linux/debian/gpg
- lsb-release repo_arch: "{{ apt_arch }}"
update_cache: true repo_components:
- stable
- name: Set dpkg arch (amd64)
set_fact:
dpkg_arch: amd64
when: ansible_architecture == 'x86_64'
- name: Set dpkg arch (arm64)
set_fact:
dpkg_arch: arm64
when: ansible_architecture == 'aarch64'
- name: Add docker repo signing key
apt_key:
id: '9DC858229FC7DD38854AE2D88D81803C0EBFCD88'
url: 'https://download.docker.com/linux/debian/gpg'
- name: Add docker repo
apt_repository:
repo: "deb [arch={{ dpkg_arch }}] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
filename: 'docker'
mode: '644'
- name: Install docker - name: Install docker
apt: apt:
@@ -36,3 +18,9 @@
- docker-ce-cli - docker-ce-cli
- containerd.io - containerd.io
- python3-docker - python3-docker
- name: Ensure docker is started and enabled
ansible.builtin.systemd:
name: docker.service
state: started
enabled: true