mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Removed server_ for better overview
This commit is contained in:
9
roles/docker-yourls/README.md
Normal file
9
roles/docker-yourls/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# role server_docker-yourls
|
||||
|
||||
## database
|
||||
|
||||
To login to the database type in:
|
||||
|
||||
```bash
|
||||
docker exec -it yourls_database_1 /bin/mysql -u yourls -p
|
||||
```
|
8
roles/docker-yourls/handlers/main.yml
Normal file
8
roles/docker-yourls/handlers/main.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: recreate yourls
|
||||
command:
|
||||
cmd: docker-compose -p yourls up -d --force-recreate
|
||||
chdir: "{{path_docker_compose_files}}yourls/"
|
||||
environment:
|
||||
COMPOSE_HTTP_TIMEOUT: 600
|
||||
DOCKER_CLIENT_TIMEOUT: 600
|
2
roles/docker-yourls/meta/main.yml
Normal file
2
roles/docker-yourls/meta/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
dependencies:
|
||||
- server_native-docker-reverse-proxy
|
21
roles/docker-yourls/tasks/main.yml
Normal file
21
roles/docker-yourls/tasks/main.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
- name: recieve {{domain}} certificate
|
||||
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}}
|
||||
|
||||
- name: configure {{domain}}.conf
|
||||
template:
|
||||
src: "roles/server_native-docker-reverse-proxy/templates/domain.conf.j2"
|
||||
dest: "/etc/nginx/conf.d/{{domain}}.conf"
|
||||
notify: restart nginx
|
||||
|
||||
- name: "create {{path_docker_compose_files}}yourls/"
|
||||
file:
|
||||
path: "{{path_docker_compose_files}}yourls/"
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
- name: add docker-compose.yml
|
||||
template:
|
||||
src: "docker-compose.yml.j2"
|
||||
dest: "{{path_docker_compose_files}}yourls/docker-compose.yml"
|
||||
notify: recreate yourls
|
45
roles/docker-yourls/templates/docker-compose.yml.j2
Normal file
45
roles/docker-yourls/templates/docker-compose.yml.j2
Normal file
@@ -0,0 +1,45 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
application:
|
||||
logging:
|
||||
driver: journald
|
||||
image: yourls
|
||||
restart: always
|
||||
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_SITE: "https://{{domain}}"
|
||||
YOURLS_USER: "{{yourls_user}}"
|
||||
YOURLS_PASS: "{{yourls_user_password}}"
|
||||
links:
|
||||
- database
|
||||
depends_on:
|
||||
- database
|
||||
database:
|
||||
logging:
|
||||
driver: journald
|
||||
image: mariadb
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_DATABASE: "yourls"
|
||||
MYSQL_USER: "yourls"
|
||||
MYSQL_PASSWORD: "{{yourls_database_password}}"
|
||||
MYSQL_ROOT_PASSWORD: "{{yourls_database_password}}"
|
||||
MARIADB_AUTO_UPGRADE: "1"
|
||||
volumes:
|
||||
- database:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: "/usr/bin/mariadb --user=yourls --password={{yourls_database_password}} --execute \"SHOW DATABASES;\""
|
||||
interval: 3s
|
||||
timeout: 1s
|
||||
retries: 5
|
||||
volumes:
|
||||
database:
|
||||
networks:
|
||||
default:
|
||||
driver: bridge
|
Reference in New Issue
Block a user