Break out docker installation to its own role
This commit is contained in:
parent
6449f80800
commit
736e803798
3 changed files with 22 additions and 3 deletions
20
roles/docker/tasks/main.yaml
Normal file
20
roles/docker/tasks/main.yaml
Normal 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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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 }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue