🔧 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:
parent
083bab14e8
commit
ae7b65cc5f
9 changed files with 19 additions and 13 deletions
6
group-docker_host.yml
Normal file
6
group-docker_host.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
- hosts: docker_host
|
||||||
|
become: true
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- role: docker_setup
|
2
group_vars/docker_host/vars.yml
Normal file
2
group_vars/docker_host/vars.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
---
|
||||||
|
docker_data_root: "/srv/docker"
|
|
@ -20,9 +20,7 @@
|
||||||
|
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: docker_setup
|
# role 'docker_setup' applied through group 'docker_host'
|
||||||
vars:
|
|
||||||
docker_data_root: "/srv/docker"
|
|
||||||
- role: apache
|
- role: apache
|
||||||
- role: apache_letsencrypt # Uses configuration from dehydrated setup
|
- role: apache_letsencrypt # Uses configuration from dehydrated setup
|
||||||
- role: ansible-role-dehydrated
|
- role: ansible-role-dehydrated
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: docker_setup
|
# role 'docker_setup' applied through group 'docker_host'
|
||||||
vars:
|
|
||||||
docker_data_root: "/srv/docker"
|
|
||||||
- role: apache
|
- role: apache
|
||||||
- role: apache_letsencrypt # Uses configuration from dehydrated setup
|
- role: apache_letsencrypt # Uses configuration from dehydrated setup
|
||||||
- role: ansible-role-dehydrated
|
- role: ansible-role-dehydrated
|
||||||
|
|
|
@ -22,9 +22,7 @@
|
||||||
brotherql_web_image: "pklaus/brother_ql_web:alpine_9e20b6d"
|
brotherql_web_image: "pklaus/brother_ql_web:alpine_9e20b6d"
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: docker_setup
|
# role 'docker_setup' applied through group 'docker_host'
|
||||||
vars:
|
|
||||||
docker_data_root: "/srv/docker"
|
|
||||||
- role: apache
|
- role: apache
|
||||||
- role: apache_letsencrypt # Uses configuration from dehydrated setup
|
- role: apache_letsencrypt # Uses configuration from dehydrated setup
|
||||||
- role: ansible-role-dehydrated
|
- role: ansible-role-dehydrated
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
dokuwiki_image: "bitnami/dokuwiki:20220731@sha256:989ab52cf2d2e0f84166e114ca4ce88f59546b8f6d34958905f8d81c18cbd759"
|
dokuwiki_image: "bitnami/dokuwiki:20220731@sha256:989ab52cf2d2e0f84166e114ca4ce88f59546b8f6d34958905f8d81c18cbd759"
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: docker_setup
|
# role 'docker_setup' applied through group 'docker_host'
|
||||||
- role: apache
|
- role: apache
|
||||||
- role: penguineer.dehydrated_cron
|
- role: penguineer.dehydrated_cron
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
vars:
|
vars:
|
||||||
ansible_python_interpreter: /usr/bin/python3
|
ansible_python_interpreter: /usr/bin/python3
|
||||||
data_dir: "/srv/data"
|
data_dir: "/srv/data"
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: docker_setup
|
# role 'docker_setup' applied through group 'docker_host'
|
||||||
vars:
|
|
||||||
docker_data_root: "/srv/docker"
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Setup the docker container for unifi-controller
|
- name: Setup the docker container for unifi-controller
|
||||||
docker_container:
|
docker_container:
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
---
|
---
|
||||||
server_admin: "admin+tau@netz39.de"
|
server_admin: "admin+tau@netz39.de"
|
||||||
mysql_root_pw: "{{ vault_mysql_root_pw }}"
|
mysql_root_pw: "{{ vault_mysql_root_pw }}"
|
||||||
|
docker_data_root: "/var/lib/docker"
|
||||||
|
|
3
main.yml
3
main.yml
|
@ -7,6 +7,9 @@
|
||||||
- name: Specific setup for all proxmox hosts
|
- name: Specific setup for all proxmox hosts
|
||||||
import_playbook: group-proxmox.yml
|
import_playbook: group-proxmox.yml
|
||||||
|
|
||||||
|
- name: Specific setup for all docker host hosts
|
||||||
|
import_playbook: group-docker_host.yml
|
||||||
|
|
||||||
- name: Tau specific setup
|
- name: Tau specific setup
|
||||||
import_playbook: host-tau.yml
|
import_playbook: host-tau.yml
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue