feat: ansible: install docker
This commit is contained in:
parent
304dc483b6
commit
141cb5e5f7
2 changed files with 58 additions and 0 deletions
45
ansible/roles/docker/tasks/main.yml
Normal file
45
ansible/roles/docker/tasks/main.yml
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
# 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
|
||||||
|
|
||||||
|
- name: Install Docker Module for Python
|
||||||
|
become: true
|
||||||
|
ansible.builtin.pip:
|
||||||
|
name: docker
|
||||||
|
|
||||||
|
- name: Ensure docker group is present
|
||||||
|
become: true
|
||||||
|
ansible.builtin.group:
|
||||||
|
name: docker
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Add user atm to docker group
|
||||||
|
become: true
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: atm # TODO: add admin user to docker group
|
||||||
|
groups: docker,users,admin
|
13
ansible/roles/ntp/tasks/main.yml
Normal file
13
ansible/roles/ntp/tasks/main.yml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
- name: Install ntp
|
||||||
|
become: true
|
||||||
|
ansible.builtin.apt:
|
||||||
|
update_cache: true
|
||||||
|
pkg:
|
||||||
|
- ntp
|
||||||
|
|
||||||
|
- name: Enable and start ntp service
|
||||||
|
become: true
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: ntp
|
||||||
|
enabled: true
|
||||||
|
state: started
|
Loading…
Reference in a new issue