christianlempa-boilerplates/vagrant/hyperv/ubuntu/docker/playbook.yaml

39 lines
897 B
YAML
Raw Normal View History

2021-06-11 15:05:20 +02:00
---
- name: Install Docker
hosts: all
become: true
2021-06-11 15:05:20 +02:00
tasks:
- name: Install prerequisites
ansible.builtin.apt:
2021-06-11 15:05:20 +02:00
name:
- apt-transport-https
2024-03-03 15:59:49 +01:00
- ca-certificates
- curl
2021-06-11 15:05:20 +02:00
- gnupg-agent
- software-properties-common
update_cache: true
- name: Add apt-key
ansible.builtin.apt_key:
2021-06-11 15:05:20 +02:00
url: https://download.docker.com/linux/ubuntu/gpg
- name: Add docker repo
ansible.builtin.apt_repository:
2021-06-11 15:05:20 +02:00
repo: deb https://download.docker.com/linux/ubuntu focal stable
- name: Install docker
ansible.builtin.apt:
2024-03-03 15:59:49 +01:00
name:
2021-06-11 15:05:20 +02:00
- docker-ce
- docker-ce-cli
- containerd.io
- docker-compose
update_cache: true
- name: Add user vagrant to group docker
ansible.builtin.user:
name: vagrant
groups: docker
append: true