forked from data.coop/ansible
We can generalise the way we setup services and "just" define the names of the services.
This commit is contained in:
parent
723868331d
commit
615ef294ba
|
@ -2,6 +2,12 @@
|
||||||
- hosts: all
|
- hosts: all
|
||||||
gather_facts: False
|
gather_facts: False
|
||||||
become: true
|
become: true
|
||||||
|
vars:
|
||||||
|
# Services are the names of the compose files in docker/files/composefiles
|
||||||
|
services:
|
||||||
|
- nginx-proxy
|
||||||
|
- gitea
|
||||||
|
- nextcloud
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- ubuntu_base
|
- ubuntu_base
|
||||||
|
|
|
@ -2,20 +2,9 @@
|
||||||
docker_network:
|
docker_network:
|
||||||
name: external_services
|
name: external_services
|
||||||
|
|
||||||
- name: setup nginx reverse proxy
|
- name: setup services
|
||||||
docker_service:
|
docker_service:
|
||||||
project_name: nginx-proxy
|
project_name: "{{ item }}"
|
||||||
definition:
|
definition:
|
||||||
"{{ lookup('file', 'composefiles/nginx-proxy.yml') | from_yaml }}"
|
"{{ lookup('file', 'composefiles/{{ item }}.yml') | from_yaml }}"
|
||||||
|
with_items: "{{ services }}"
|
||||||
- name: setup gitea
|
|
||||||
docker_service:
|
|
||||||
project_name: gitea
|
|
||||||
definition:
|
|
||||||
"{{ lookup('file', 'composefiles/gitea.yml') | from_yaml }}"
|
|
||||||
|
|
||||||
- name: setup nextcloud
|
|
||||||
docker_service:
|
|
||||||
project_name: nextcloud
|
|
||||||
definition:
|
|
||||||
"{{ lookup('file', 'composefiles/nextcloud.yml') | from_yaml }}"
|
|
||||||
|
|
Loading…
Reference in a new issue