fp/ansible/roles/docker/tasks/docker.yml
CJ_Clippy 325fe576e2
Some checks failed
ci / test (push) Failing after 6m3s
fp/our CI/CD / build (push) Successful in 1m27s
add ipfs playbook
2025-10-04 08:45:34 -08:00

53 lines
1.2 KiB
YAML

---
- name: Ensure prerequisites are installed
become: true
ansible.builtin.apt:
name:
- ca-certificates
- curl
state: present
update_cache: true
- name: Ensure /etc/apt/keyrings directory exists
become: true
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
mode: "0755"
- name: Download Docker GPG key
become: true
ansible.builtin.get_url:
url: https://download.docker.com/linux/ubuntu/gpg
dest: /etc/apt/keyrings/docker.asc
mode: "0644"
- name: Add Docker APT repository
become: true
ansible.builtin.apt_repository:
repo: "deb [arch={{ ansible_architecture }} signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable"
state: present
filename: docker
update_cache: true
- name: Install docker
become: true
ansible.builtin.apt:
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
state: present
update_cache: true
- name: Install docker ansible module dependencies
ansible.builtin.pip:
name: "{{ item }}"
state: present
loop:
- jsondiff
- pyyaml
- docker