ansible-wordpress-host-init/roles/install-docker/tasks/main.yml

31 lines
949 B
YAML
Raw Normal View History

2023-03-27 16:38:19 +00:00
---
- name: Install Docker prerequisites
become: true
apt:
pkg:
- gnupg
- curl
- name: Prepare keyring folder
become: true
file:
path: /etc/apt/keyrings
state: directory
mode: '0744'
- name: Get keyring
become: true
shell: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
- name: Add repository
become: true
shell: echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-pluginsudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-pluginlinux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
- name: Update repository and install docker
apt:
pkg:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-compose-plugin
update_cache: yes