mirror of
https://gitea.0xace.cc/ansible-galaxy/docker.git
synced 2025-04-05 08:01:55 +00:00
44 lines
979 B
YAML
44 lines
979 B
YAML
---
|
|
- name: Install apt-transport-https and gnupg
|
|
apt:
|
|
name:
|
|
- apt-transport-https
|
|
- gnupg
|
|
update_cache: yes
|
|
state: present
|
|
|
|
- name: Add gpg keys for Docker repo
|
|
ansible.builtin.apt_key:
|
|
url: "{{ item.url }}"
|
|
keyring: "{{ item.keyring }}"
|
|
loop: "{{ docker_apt_key }}"
|
|
when: docker_install_official_repo
|
|
|
|
- name: Add Docker repository
|
|
ansible.builtin.apt_repository:
|
|
repo: "{{ item.repo }}"
|
|
state: present
|
|
filename: "{{ item.filename }}"
|
|
update_cache: yes
|
|
loop: "{{ docker_apt_repository }}"
|
|
when: docker_install_official_repo
|
|
|
|
- name: Ensure {{ docker_package }} installed
|
|
apt:
|
|
name: "{{ docker_packages }}"
|
|
state: present
|
|
update_cache: yes
|
|
|
|
- name: Ensure docker service enabled and started
|
|
systemd:
|
|
name: "{{ docker_unit_name }}"
|
|
enabled: yes
|
|
state: started
|
|
masked: no
|
|
|
|
- name: Ensure python3-docker installed
|
|
apt:
|
|
name: python3-docker
|
|
state: present
|
|
update_cache: yes
|