mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2024-11-22 00:03:16 +01:00
removed old docker installation, added new one for ubuntu
This commit is contained in:
parent
a5378bc268
commit
128adf9ce3
34
ansible/installation/inst-docker-ubuntu.yaml
Normal file
34
ansible/installation/inst-docker-ubuntu.yaml
Normal file
@ -0,0 +1,34 @@
|
||||
---
|
||||
- name: install docker
|
||||
hosts: "{{ hosts }}"
|
||||
become: yes
|
||||
tasks:
|
||||
- name: install docker dependencies
|
||||
apt:
|
||||
name:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- curl
|
||||
- gnupg-agent
|
||||
- software-properties-common
|
||||
update_cache: yes
|
||||
- name: add docker gpg key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/ubuntu/gpg
|
||||
state: present
|
||||
keyring: /etc/apt/keyrings/docker.gpg
|
||||
- name: add docker repository
|
||||
apt_repository:
|
||||
filename: docker
|
||||
repo: deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename|lower }} stable
|
||||
state: present
|
||||
- name: install docker engine
|
||||
apt:
|
||||
name:
|
||||
- docker-ce
|
||||
- docker-ce-cli
|
||||
- containerd.io
|
||||
- docker-buildx-plugin
|
||||
- docker-scan-plugin
|
||||
- docker-compose-plugin
|
||||
update_cache: yes
|
@ -1,25 +0,0 @@
|
||||
---
|
||||
- name: install docker
|
||||
hosts: "{{ hosts }}"
|
||||
become: yes
|
||||
tasks:
|
||||
- name: install prerequisites
|
||||
apt:
|
||||
name:
|
||||
- docker.io
|
||||
update_cache: yes
|
||||
- name: add user permissions
|
||||
user:
|
||||
name: "{{ ansible_env.SUDO_USER }}"
|
||||
groups: docker
|
||||
- name: Reset ssh connection for changes to take effect
|
||||
meta: "reset_connection"
|
||||
- name: install python package manager
|
||||
apt:
|
||||
name: python3-pip
|
||||
- name: install python sdk
|
||||
become_user: "{{ ansible_env.SUDO_USER }}"
|
||||
pip:
|
||||
name:
|
||||
- docker
|
||||
- docker-compose
|
Loading…
Reference in New Issue
Block a user