Setup and install docker

This commit is contained in:
Jake Howard 2020-01-28 21:32:29 +00:00
parent d61cb64c7e
commit 9d8e7cbc9c
Signed by: jake
GPG key ID: 57AFB45680EDD477
4 changed files with 40 additions and 0 deletions

View file

@ -10,3 +10,4 @@
- hosts: intersect - hosts: intersect
roles: roles:
- ssh - ssh
- docker

View file

@ -0,0 +1,5 @@
- name: Include docker variables
include_vars: docker.yml
- name: Install Docker
include: setup-docker.yml

View file

@ -0,0 +1,31 @@
- name: Add an Apt signing key, uses whichever key is at the URL
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
become: true
become_user: root
- name: Add docker repo
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
state: present
become: true
become_user: root
- name: Install Docker and docker-compose
apt:
name: "{{ item }}"
become: true
become_user: root
loop:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-compose
- name: Create docker user
user:
name: "{{ docker_user.name }}"
uid: "{{ docker_user.id }}"
group: "{{ docker_user.name }}"
create_home: false

View file

@ -0,0 +1,3 @@
docker_user:
id: 3000
name: dockeruser