mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-22 04:31:13 +01:00
Compare commits
5 Commits
a6670ddb01
...
c1f33aadba
Author | SHA1 | Date | |
---|---|---|---|
c1f33aadba | |||
67bd15b5cf | |||
a48a0d8f92 | |||
3af533a17c | |||
cd87e7a38c |
@ -1,6 +1,7 @@
|
||||
# General
|
||||
verbose: false # Prints well formated debug information
|
||||
top_domain: "localhost"
|
||||
verbose: false # Prints well formated debug information
|
||||
top_domain: "localhost"
|
||||
backups_folder_path: "/Backups/"
|
||||
|
||||
# Server Tact Variables
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: receive {{ mail_interface_domain }} certificate
|
||||
command: certbot certonly --agree-tos --email {{ administrator_email }} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{ mail_interface_domain }}
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,4 +1,11 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: load docker compose dependencies
|
||||
include_role:
|
||||
name: docker-compose
|
||||
|
||||
- name: "include task certbot-matomo.yml"
|
||||
include_tasks: certbot-matomo.yml
|
||||
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- nginx-docker-reverse-proxy
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -1,3 +1,2 @@
|
||||
dependencies:
|
||||
- docker-compose
|
||||
- systemd-notifier
|
||||
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -4,6 +4,11 @@
|
||||
state: present
|
||||
when: run_once_docker_mariadb is not defined
|
||||
|
||||
- name: Create a volume for MariaDB socket
|
||||
docker_volume:
|
||||
name: mariadb_socket
|
||||
when: run_once_docker_mariadb is not defined
|
||||
|
||||
- name: install MariaDB
|
||||
docker_container:
|
||||
name: central-mariadb
|
||||
@ -15,39 +20,41 @@
|
||||
networks:
|
||||
- name: central_mariadb_network
|
||||
volumes:
|
||||
- database:/var/lib/mysql
|
||||
- central_mariadb_database:/var/lib/mysql
|
||||
published_ports:
|
||||
- "127.0.0.1:3306:3306"
|
||||
- "127.0.0.1:3306:3306" # can be that this will be removed if all applications use sockets
|
||||
command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW" #for nextcloud
|
||||
when: run_once_docker_mariadb is not defined
|
||||
|
||||
- name: wait for availability of mariadb
|
||||
wait_for:
|
||||
host: "127.0.0.1"
|
||||
port: "3306"
|
||||
delay: 0
|
||||
timeout: 120
|
||||
when: run_once_docker_mariadb is not defined
|
||||
|
||||
- name: install python-mysqlclient
|
||||
pacman:
|
||||
name: python-mysqlclient
|
||||
state: present
|
||||
when: run_once_docker_mariadb is not defined
|
||||
|
||||
- name: wait for database
|
||||
wait_for:
|
||||
host: 127.0.0.1
|
||||
port: 3306
|
||||
delay: 10
|
||||
timeout: 300
|
||||
when: run_once_docker_mariadb is not defined
|
||||
|
||||
- name: create database
|
||||
mysql_db:
|
||||
name: "{{database_databasename}}"
|
||||
name: "{{ database_databasename }}"
|
||||
state: present
|
||||
login_user: root
|
||||
login_password: "{{central_mariadb_root_password}}"
|
||||
login_password: "{{ central_mariadb_root_password }}"
|
||||
login_host: 127.0.0.1
|
||||
login_port: 3306
|
||||
|
||||
|
||||
- name: create database user
|
||||
mysql_user:
|
||||
name: "{{database_username}}"
|
||||
password: "{{database_password}}"
|
||||
host: "%"
|
||||
priv: '{{database_databasename}}.*:ALL'
|
||||
state: present
|
||||
login_user: root
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include create-domains.yml"
|
||||
include_tasks: create-domains.yml
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -20,10 +20,10 @@
|
||||
image: mariadb
|
||||
environment:
|
||||
MYSQL_DATABASE: mediawiki
|
||||
MYSQL_ROOT_PASSWORD: "{{mediawiki_mysql_user_password}}"
|
||||
MYSQL_ROOT_PASSWORD: "{{mediawiki_database_password}}"
|
||||
MYSQL_USER: mediawiki
|
||||
MYSQL_PASSWORD: "{{mediawiki_mysql_user_password}}"
|
||||
MYSQL_PASSWORD: "{{mediawiki_database_password}}"
|
||||
MARIADB_AUTO_UPGRADE: "1"
|
||||
volumes:
|
||||
- mediawiki-database:/var/lib/mysql
|
||||
- database:/var/lib/mysql
|
||||
restart: always
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks create-proxy-with-domain-replace.yml"
|
||||
include_tasks: create-proxy-with-domain-replace.yml
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include task certbot-matomo.yml"
|
||||
include_tasks: certbot-matomo.yml
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include create-domains.yml"
|
||||
include_tasks: create-domains.yml
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- docker-compose
|
@ -1,11 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -1,15 +1,6 @@
|
||||
---
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: load docker compose dependencies
|
||||
include_role:
|
||||
name: docker-compose
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
||||
- name: "include docker-compose-common.yml"
|
||||
include_tasks: docker-compose-common.yml
|
||||
|
||||
- name: "include tasks nginx-docker-proxy-domain.yml"
|
||||
include_tasks: nginx-docker-proxy-domain.yml
|
||||
|
@ -12,13 +12,14 @@ services:
|
||||
ports:
|
||||
- "127.0.0.1:{{http_port}}:80"
|
||||
environment:
|
||||
YOURLS_DB_HOST: "database:3306"
|
||||
YOURLS_DB_USER: "yourls"
|
||||
YOURLS_DB_PASS: "{{yourls_database_password}}"
|
||||
YOURLS_DB_NAME: "yourls"
|
||||
YOURLS_DB_HOST: "{{database_host}}"
|
||||
YOURLS_DB_USER: "{{database_username}}"
|
||||
YOURLS_DB_PASS: "{{database_password}}"
|
||||
YOURLS_DB_NAME: "{{database_databasename}}"
|
||||
YOURLS_SITE: "https://{{domain}}"
|
||||
YOURLS_USER: "{{yourls_user}}"
|
||||
YOURLS_PASS: "{{yourls_user_password}}"
|
||||
|
||||
{% include 'templates/docker-container-depends-on-just-database.yml.j2' %}
|
||||
{% include 'templates/docker-container-networks.yml.j2' %}
|
||||
|
||||
|
11
tasks/docker-compose-common.yml
Normal file
11
tasks/docker-compose-common.yml
Normal file
@ -0,0 +1,11 @@
|
||||
- name: include docker vars
|
||||
include_vars: vars/docker-database-service.yml.j2
|
||||
|
||||
- name: load docker compose dependencies
|
||||
include_role:
|
||||
name: docker-compose
|
||||
|
||||
- name: create central database
|
||||
include_role:
|
||||
name: docker-{{database_type}}
|
||||
when: enable_central_database | bool
|
Loading…
Reference in New Issue
Block a user