feat: docker gpg key + repository install
This commit is contained in:
37
deploy/docker-install.yml
Normal file
37
deploy/docker-install.yml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
- name: Installing Docker and Docker Compose
|
||||||
|
hosts: hosts
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Clear previous install of Docker
|
||||||
|
ansible.builtin.apt:
|
||||||
|
pkg:
|
||||||
|
- docker.io
|
||||||
|
- docker-compose
|
||||||
|
- docker-compose-v2
|
||||||
|
- docker-doc
|
||||||
|
- podman-docker
|
||||||
|
- containerd
|
||||||
|
state: absent
|
||||||
|
autoremove: true
|
||||||
|
|
||||||
|
- name: Install pre-requirements
|
||||||
|
ansible.builtin.apt:
|
||||||
|
update_cache: yes
|
||||||
|
pkg:
|
||||||
|
- ca-certificates
|
||||||
|
- curl
|
||||||
|
|
||||||
|
- name: Add Docker GPG key and Repository
|
||||||
|
become: true
|
||||||
|
block:
|
||||||
|
- name: somerepo | no apt key
|
||||||
|
ansible.builtin.get_url:
|
||||||
|
url: https://download.docker.com/linux/ubuntu/gpg
|
||||||
|
dest: /etc/apt/keyrings/docker.asc
|
||||||
|
|
||||||
|
- name: somerepo | apt source
|
||||||
|
ansible.builtin.apt_repository:
|
||||||
|
repo: "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user