iac/ansible/roles/docker/tasks/main.yml

47 lines
1 KiB
YAML
Raw Normal View History

2023-08-17 05:04:41 +05:30
---
2023-08-17 04:57:58 +05:30
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
- name: Create /etc/apt/keyrings dir
become: true
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
recurse: true
- name: Add Docker GPG apt Key
become: true
ansible.builtin.apt_key:
url: https://download.docker.com/linux/debian/gpg
state: present
- name: Add Docker Repository
become: true
ansible.builtin.apt_repository:
repo: deb https://download.docker.com/linux/debian buster stable
state: present
- name: Update apt and install docker-ce
become: true
ansible.builtin.apt:
name: docker-ce
update_cache: true
2023-10-13 19:19:46 +05:30
#- name: Install Docker Module for Python
2023-10-12 20:47:07 +05:30
# become: true
# community.general.pipx:
# name: docker
2023-08-17 04:57:58 +05:30
- name: Ensure docker group is present
become: true
ansible.builtin.group:
name: docker
state: present
2023-12-09 03:30:10 +05:30
- name: Add user to docker group
2023-08-17 04:57:58 +05:30
become: true
ansible.builtin.user:
2023-12-09 03:30:10 +05:30
name: "{{ ansible_user_id }}"
2023-08-17 04:57:58 +05:30
groups: docker,users,admin