🔧 Move docker_setup role application to group playbook

To install docker on a host you have to put it into that group in
inventory now, instead of adding the role to each host playbook.  Idea
is to extend the group docker_host playbook by more docker related
things as for example metrics and monitoring.
This commit is contained in:
Alexander Dahl 2022-12-12 18:53:03 +01:00
parent 083bab14e8
commit ae7b65cc5f
9 changed files with 19 additions and 13 deletions

6
group-docker_host.yml Normal file
View file

@ -0,0 +1,6 @@
---
- hosts: docker_host
become: true
roles:
- role: docker_setup

View file

@ -0,0 +1,2 @@
---
docker_data_root: "/srv/docker"

View file

@ -20,9 +20,7 @@
roles:
- role: docker_setup
vars:
docker_data_root: "/srv/docker"
# role 'docker_setup' applied through group 'docker_host'
- role: apache
- role: apache_letsencrypt # Uses configuration from dehydrated setup
- role: ansible-role-dehydrated

View file

@ -3,9 +3,7 @@
become: true
roles:
- role: docker_setup
vars:
docker_data_root: "/srv/docker"
# role 'docker_setup' applied through group 'docker_host'
- role: apache
- role: apache_letsencrypt # Uses configuration from dehydrated setup
- role: ansible-role-dehydrated

View file

@ -22,9 +22,7 @@
brotherql_web_image: "pklaus/brother_ql_web:alpine_9e20b6d"
roles:
- role: docker_setup
vars:
docker_data_root: "/srv/docker"
# role 'docker_setup' applied through group 'docker_host'
- role: apache
- role: apache_letsencrypt # Uses configuration from dehydrated setup
- role: ansible-role-dehydrated

View file

@ -17,7 +17,7 @@
dokuwiki_image: "bitnami/dokuwiki:20220731@sha256:989ab52cf2d2e0f84166e114ca4ce88f59546b8f6d34958905f8d81c18cbd759"
roles:
- role: docker_setup
# role 'docker_setup' applied through group 'docker_host'
- role: apache
- role: penguineer.dehydrated_cron

View file

@ -5,10 +5,10 @@
vars:
ansible_python_interpreter: /usr/bin/python3
data_dir: "/srv/data"
roles:
- role: docker_setup
vars:
docker_data_root: "/srv/docker"
# role 'docker_setup' applied through group 'docker_host'
tasks:
- name: Setup the docker container for unifi-controller
docker_container:

View file

@ -1,3 +1,4 @@
---
server_admin: "admin+tau@netz39.de"
mysql_root_pw: "{{ vault_mysql_root_pw }}"
docker_data_root: "/var/lib/docker"

View file

@ -7,6 +7,9 @@
- name: Specific setup for all proxmox hosts
import_playbook: group-proxmox.yml
- name: Specific setup for all docker host hosts
import_playbook: group-docker_host.yml
- name: Tau specific setup
import_playbook: host-tau.yml