Merge pull request 'add-influx-db' (!89) from add-influx-db into master

Reviewed-on: https://gitea.n39.eu/Netz39_Admin/netz39-infra-ansible/pulls/89
Reviewed-by: tux <tux@netz39.de>
This commit is contained in:
Stefan Haun 2022-10-20 21:11:10 +00:00
commit 60ba85f42c
3 changed files with 45 additions and 0 deletions

View file

@ -28,6 +28,8 @@
local: true
- name: jabber.n39.eu
- name: conference.jabber.n39.eu
- name: influx.n39.eu
local: true
- server: radon
hosts:
- name: nodered.n39.eu

View file

@ -102,6 +102,14 @@ all:
32366339366433626466306634383563343633343736393735336130363462346265646431393839
3566326231663663340a383731353935366234643132386438663736313938356266613432303232
3165
influxdb_init_username: admin
influxdb_init_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
30316166356665623137386637353262316230616462356365333734323464363438666461323262
6463643839386563313765323534386365396131323462650a313737643139656638373265623433
37663136346132623166336139303234323433616634336332663133653532643336303362303161
3231306434626336370a363265643462366231326263313563306366393930633765633934386362
34316566643132353936636661623365663331333636636462316366623366383864
unicorn.n39.eu:
server_admin: "admin+unicorn@netz39.de"
platon.n39.eu:

View file

@ -24,6 +24,9 @@
redmine_mysql_image: mysql:5.7
redmine_database: redmine
influxdb_host_port: 8088
influxdb_image: influxdb:2.4-alpine
roles:
- role: docker_setup
vars:
@ -44,6 +47,7 @@
- conference.jabber.n39.eu
deploy_cert_hook: "docker exec prosody prosodyctl --root cert import ${DOMAIN} /var/lib/dehydrated/certs"
- name: redmine.n39.eu
- name: influx.n39.eu
- role: penguineer.dehydrated_cron
- role: dd24-dyndns-cron
# variables are set in the inventory
@ -258,6 +262,37 @@
site_name: pad.n39.eu
proxy_port: "{{ hedgedoc_host_port }}"
- name: Ensure the influxdb directories exist
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ data_dir }}/influxdb"
- name: Ensure container for influxdb is running
docker_container:
name: influxdb
image: "{{ influxdb_image }}"
pull: true
state: started
detach: yes
ports:
- "127.0.0.1:{{ influxdb_host_port }}:8086"
restart_policy: unless-stopped
env:
DOCKER_INFLUXDB_INIT_USERNAME: "{{ influxdb_init_username }}"
DOCKER_INFLUXDB_INIT_PASSWORD: "{{ influxdb_init_password }}"
DOCKER_INFLUXDB_INIT_ORG: Netz39
DOCKER_INFLUXDB_INIT_BUCKET: default
volumes:
- "{{ data_dir }}/influxdb:/var/lib/influxdb2"
- name: Setup proxy site influx.n39.eu
include_role:
name: setup-http-site-proxy
vars:
site_name: influx.n39.eu
proxy_port: "{{ influxdb_host_port }}"
# Expected setup for the data directory
# file: configuration.yml