Compare commits
8 Commits
9d7d11c384
...
472ad4286f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
472ad4286f | ||
|
|
9103bafb8d | ||
|
|
aa7216d6e2 | ||
|
|
c569974ba7 | ||
|
|
d5f2bb84c6 | ||
|
|
265270eed3 | ||
|
|
93e76562f4 | ||
|
|
0541367cb3 |
@@ -3,7 +3,7 @@
|
||||
namespace: uumas
|
||||
name: docker
|
||||
description: Roles for installing services in docker containers
|
||||
version: 0.7.2
|
||||
version: 0.8.0
|
||||
readme: README.md
|
||||
repository: https://git.uumas.fi/uumas/ansible-docker
|
||||
license_file: LICENSE
|
||||
|
||||
1
roles/alpine/README.md
Normal file
1
roles/alpine/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Sets up an alpine docker container. To be used as a template for other roles.
|
||||
39
roles/alpine/meta/argument_specs.yml
Normal file
39
roles/alpine/meta/argument_specs.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
|
||||
argument_specs:
|
||||
main:
|
||||
short_description: Alpine container
|
||||
description: "Sets up an alpine docker container. This role can be used as a template for other roles using the container role."
|
||||
options:
|
||||
|
||||
# All options after this will be passed directly to the container role
|
||||
docker_service_suffix:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
docker_host_user:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
|
||||
database_passwords:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
docker_additional_services:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
|
||||
docker_volume_type:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
reverse_proxy_type:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
ports:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
docker_vhost_domains:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
docker_entrypoint:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
|
||||
15
roles/alpine/tasks/main.yml
Normal file
15
roles/alpine/tasks/main.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: Alpine container
|
||||
import_role:
|
||||
name: container
|
||||
vars:
|
||||
docker_service: alpine
|
||||
docker_image: alpine
|
||||
docker_image_http_port: 8080
|
||||
docker_database: postgres
|
||||
docker_mounts:
|
||||
- name: data
|
||||
path: /data
|
||||
docker_env:
|
||||
TZ: "{{ timezone }}"
|
||||
@@ -33,7 +33,7 @@ argument_specs:
|
||||
- mongo
|
||||
- none
|
||||
default: none
|
||||
databse_passwords:
|
||||
database_passwords:
|
||||
description: "database_passwords[docker_service] is a string with the password used for communication between the service and database. Required if docker_database is postgres or mariadb"
|
||||
type: dict
|
||||
required: false
|
||||
@@ -99,9 +99,9 @@ argument_specs:
|
||||
ports:
|
||||
description: "ports[docker_service]['http'] or ports[docker_service]['https'] defines the port on which the container will listen on for reverse proxy connections. Required if reverse_proxy_type is caddy."
|
||||
type: dict
|
||||
required: false
|
||||
docker_vhost_domains:
|
||||
description: "docker_vhost_domains[docker_service] is a list which defines which domains should be proxied to the container. Required if reverse_proxy_type is not none"
|
||||
type: dict
|
||||
docker_published_ports:
|
||||
description: "A list of published ports in docker format (<host listen address>:<host port>:<container port>)"
|
||||
type: list
|
||||
|
||||
1
roles/dokuwiki/README.md
Normal file
1
roles/dokuwiki/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Sets up a dokuwiki docker container.
|
||||
4
roles/dokuwiki/defaults/main.yml
Normal file
4
roles/dokuwiki/defaults/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
dokuwiki_wiki_name: DokuWiki
|
||||
dokuwiki_admin_email: "{{ admin_email }}"
|
||||
45
roles/dokuwiki/meta/argument_specs.yml
Normal file
45
roles/dokuwiki/meta/argument_specs.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
|
||||
argument_specs:
|
||||
main:
|
||||
short_description: DokuWiki container
|
||||
description: "Sets up a DokuWiki docker container."
|
||||
options:
|
||||
dokuwiki_wiki_name:
|
||||
description: Name of the DokuWiki site
|
||||
type: str
|
||||
reuired: false
|
||||
default: DokuWiki
|
||||
dokuwiki_admin_password:
|
||||
description: Password of dokuwiki admin user
|
||||
type: str
|
||||
required: true
|
||||
dokuwiki_admin_email:
|
||||
description: Email address of dokuwiki admin user
|
||||
type: str
|
||||
required: false
|
||||
default: "{{ admin_email }}"
|
||||
|
||||
# All options after this will be passed directly to the container role
|
||||
docker_service_suffix:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
docker_host_user:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
|
||||
docker_volume_type:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
reverse_proxy_type:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
ports:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
docker_vhost_domains:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
docker_entrypoint:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
18
roles/dokuwiki/tasks/main.yml
Normal file
18
roles/dokuwiki/tasks/main.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
|
||||
- name: Dokuwiki container
|
||||
import_role:
|
||||
name: container
|
||||
vars:
|
||||
docker_service: dokuwiki
|
||||
docker_image: bitnami/dokuwiki
|
||||
docker_image_http_port: 8080
|
||||
docker_mounts:
|
||||
- name: data
|
||||
path: /bitnami/dokuwiki
|
||||
docker_env:
|
||||
DOKUWIKI_USERNAME: admin
|
||||
DOKUWIKI_FULL_NAME: Admin
|
||||
DOKUWIKI_PASSWORD: "{{ dokuwiki_admin_password }}"
|
||||
DOKUWIKI_EMAIL: "{{ dokuwiki_admin_email }}"
|
||||
DOKUWIKI_WIKI_NAME: "{{ dokuwiki_wiki_name }}"
|
||||
1
roles/grafana/README.md
Normal file
1
roles/grafana/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Sets up a grafana docker container.
|
||||
38
roles/grafana/meta/argument_specs.yml
Normal file
38
roles/grafana/meta/argument_specs.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
|
||||
argument_specs:
|
||||
main:
|
||||
short_description: Alpine container
|
||||
description: "Sets up an alpine docker container. This role can be used as a template for other roles using the container role."
|
||||
options:
|
||||
database_passwords:
|
||||
description: "Passed to container role"
|
||||
required: true
|
||||
type: dict
|
||||
docker_vhost_domains:
|
||||
description: "Passed to container role"
|
||||
required: true
|
||||
type: dict
|
||||
|
||||
# All options after this will be passed directly to the container role
|
||||
docker_host_user:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
|
||||
docker_additional_services:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
|
||||
docker_volume_type:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
reverse_proxy_type:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
ports:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
docker_entrypoint:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
|
||||
21
roles/grafana/tasks/main.yml
Normal file
21
roles/grafana/tasks/main.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
|
||||
- name: Grafana container
|
||||
import_role:
|
||||
name: container
|
||||
vars:
|
||||
docker_service: grafana
|
||||
docker_image: grafana/grafana
|
||||
docker_image_http_port: 3000
|
||||
docker_volumes:
|
||||
- name: data
|
||||
path: /var/lib/grafana
|
||||
docker_database: postgres
|
||||
docker_env:
|
||||
GF_DATABASE_TYPE: postgres
|
||||
GF_DATABASE_HOST: grafana_db:5432
|
||||
GF_DATABASE_NAME: grafana
|
||||
GF_DATABASE_USER: grafana
|
||||
GF_DATABASE_PASSWORD: "{{ database_passwords.grafana }}"
|
||||
GF_SERVER_DOMAIN: "{{ docker_vhost_domains.grafana[0] }}"
|
||||
GF_SERVER_ROOT_URL: "https://{{ docker_vhost_domains.grafana[0] }}"
|
||||
1
roles/prometheus/README.md
Normal file
1
roles/prometheus/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Sets up a prometheus docker container.
|
||||
6
roles/prometheus/defaults/main.yml
Normal file
6
roles/prometheus/defaults/main.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
|
||||
prometheus_scrape_interval: 5s
|
||||
prometheus_evaluation_interval: 15s
|
||||
prometheus_install_grafana: false
|
||||
prometheus_hcloud_relabel_configs: []
|
||||
73
roles/prometheus/meta/argument_specs.yml
Normal file
73
roles/prometheus/meta/argument_specs.yml
Normal file
@@ -0,0 +1,73 @@
|
||||
---
|
||||
|
||||
argument_specs:
|
||||
main:
|
||||
short_description: Prometheus docker container
|
||||
options:
|
||||
prometheus_scrape_interval:
|
||||
description: Interval how often prometheus will scrape the monitoring targets
|
||||
type: str
|
||||
required: false
|
||||
default: 5s
|
||||
prometheus_evaluation_interval:
|
||||
description: Interval how often prometheus will evaluate the scraped metrics against defined conditions
|
||||
type: str
|
||||
required: false
|
||||
default: 15s
|
||||
prometheus_hcloud_token:
|
||||
description: Access token for hetzner cloud service discovery. It will be enabled if this variable is defined
|
||||
type: str
|
||||
required: false
|
||||
prometheus_hcloud_relabel_configs:
|
||||
description: Relabel configs for hcloud
|
||||
type: list
|
||||
required: false
|
||||
default: []
|
||||
elements: dict
|
||||
options:
|
||||
source_labels:
|
||||
type: list
|
||||
required: true
|
||||
elements: str
|
||||
target_label:
|
||||
type: str
|
||||
required: true
|
||||
replacement:
|
||||
type: str
|
||||
required: false
|
||||
prometheus_install_grafana:
|
||||
description: If true, installs grafana in the same docker network as prometheus and configures it with prometheus as data source
|
||||
type: bool
|
||||
required: false
|
||||
default: false
|
||||
|
||||
# All options after this will be passed directly to the container role
|
||||
docker_service_suffix:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
docker_host_user:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
|
||||
database_passwords:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
docker_additional_services:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
|
||||
docker_volume_type:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
reverse_proxy_type:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
ports:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
docker_vhost_domains:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
docker_entrypoint:
|
||||
description: "Passed to container role"
|
||||
required: false
|
||||
22
roles/prometheus/tasks/main.yml
Normal file
22
roles/prometheus/tasks/main.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
|
||||
- name: Prometheus container
|
||||
import_role:
|
||||
name: container
|
||||
vars:
|
||||
docker_service: prometheus
|
||||
docker_image: prom/prometheus
|
||||
reverse_proxy_type: none
|
||||
docker_volumes:
|
||||
- name: data
|
||||
path: /prometheus
|
||||
- template: prometheus.yml
|
||||
path: /etc/prometheus/prometheus.yml
|
||||
|
||||
- name: Grafana container for prometheus
|
||||
include_role:
|
||||
name: grafana
|
||||
vars:
|
||||
docker_networks:
|
||||
- name: prometheus
|
||||
when: prometheus_install_grafana
|
||||
34
roles/prometheus/templates/prometheus.yml.j2
Normal file
34
roles/prometheus/templates/prometheus.yml.j2
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
|
||||
# my global config
|
||||
global:
|
||||
scrape_interval: {{ prometheus_scrape_interval }}
|
||||
evaluation_interval: {{ prometheus_evaluation_interval }}
|
||||
|
||||
# Alertmanager configuration
|
||||
alerting:
|
||||
alertmanagers:
|
||||
- static_configs:
|
||||
- targets:
|
||||
# - alertmanager:9093
|
||||
|
||||
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
|
||||
rule_files:
|
||||
# - "first_rules.yml"
|
||||
# - "second_rules.yml"
|
||||
|
||||
# A scrape configuration containing exactly one endpoint to scrape:
|
||||
# Here it's Prometheus itself.
|
||||
scrape_configs:
|
||||
- job_name: "prometheus"
|
||||
static_configs:
|
||||
- targets: ["localhost:9090"]
|
||||
|
||||
{% if prometheus_hcloud_token is defined %}
|
||||
- job_name: hcloud
|
||||
hetzner_sd_configs:
|
||||
- role: hcloud
|
||||
authorization:
|
||||
credentials: {{ prometheus_hcloud_token }}
|
||||
relabel_configs: {{ prometheus_hcloud_relabel_configs }}
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user