Use ansible galaxy to install docker

This commit is contained in:
Jake Howard
2020-03-02 19:37:11 +00:00
parent 1af9fd508f
commit 85f6f59970
6 changed files with 15 additions and 21 deletions

View File

@ -2,6 +2,7 @@
nocows = 1
host_key_checking = False
retry_files_enabled = False
roles_path = $PWD/galaxy_roles:$PWD/roles
inventory = ./hosts
become_ask_pass = True

View File

@ -10,4 +10,10 @@
- hosts: intersect
roles:
- ssh
- role: geerlingguy.docker
become: true
vars:
docker_install_compose: false # This role installs the binary directly, which is kinda nasty
docker_users:
- "{{ user }}"
- docker

View File

@ -0,0 +1 @@
- src: geerlingguy.docker

View File

@ -1,27 +1,8 @@
- name: Add docker apt key
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
- name: Install docker-compose
apt:
name: "{{ item }}"
name: "docker-compose"
become: true
become_user: root
loop:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-compose
- name: Create docker user
user: