Break out docker installation to its own role

This commit is contained in:
Erik Stambaugh 2022-01-03 07:41:24 -08:00
parent 6449f80800
commit 736e803798
3 changed files with 22 additions and 3 deletions

View file

@ -0,0 +1,20 @@
---
- name: install docker
apt:
force_apt_get: yes
name: "{{ packages }}"
vars:
packages:
- docker.io
- docker-compose
- name: Add users to docker group
user:
name: "{{ item }}"
groups: docker
append: yes
with_items:
- ubuntu

View file

@ -10,14 +10,12 @@
- data - data
- nginx/conf.d - nginx/conf.d
- name: install docker - name: install dependencies
apt: apt:
force_apt_get: yes force_apt_get: yes
name: "{{ packages }}" name: "{{ packages }}"
vars: vars:
packages: packages:
- docker.io
- docker-compose
- openssl - openssl
- name: Add users to docker group - name: Add users to docker group

View file

@ -11,5 +11,6 @@
- name: setup nextcloud instance - name: setup nextcloud instance
hosts: nextcloud hosts: nextcloud
roles: roles:
- { role: docker, become: yes }
- { role: nextcloud, become: yes } - { role: nextcloud, become: yes }