Add influxdb to ansible

This commit is contained in:
Tobias Reisinger 2023-06-17 13:24:02 +02:00
parent 96fd62dc3d
commit 2500d672fb
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
12 changed files with 102 additions and 87 deletions

9
.gitignore vendored
View file

@ -7,11 +7,14 @@ diagram_assets/
# services already handled by ansible # services already handled by ansible
/acme-dns/ /acme-dns/
/caddy/config/conf.002.d/acme.serguzim.me.conf
/gitea/ /gitea/
/caddy/config/conf.002.d/git.serguzim.me.conf /influxdb/
/umami/ /umami/
/caddy/config/conf.002.d/analytics.serguzim.me.conf
/watchtower/ /watchtower/
/wiki-js/ /wiki-js/
/caddy/config/conf.002.d/acme.serguzim.me.conf
/caddy/config/conf.002.d/analytics.serguzim.me.conf
/caddy/config/conf.002.d/git.serguzim.me.conf
/caddy/config/conf.002.d/tick.serguzim.me.conf
/caddy/config/conf.002.d/wiki.serguzim.me.conf /caddy/config/conf.002.d/wiki.serguzim.me.conf

View file

@ -9,6 +9,7 @@
roles: roles:
- acme-dns - acme-dns
- gitea - gitea
- influxdb
- umami - umami
- watchtower - watchtower
- wiki-js - wiki-js

View file

@ -4,6 +4,7 @@
roles: roles:
- acme-dns - acme-dns
- gitea - gitea
- influxdb
- umami - umami
- watchtower - watchtower
- wiki-js - wiki-js

View file

@ -0,0 +1,17 @@
---
- name: Deploy {{ svc.name }}
tags:
- influxdb
- sensors
block:
- import_tasks: steps/create-service-directory.yml
- import_tasks: steps/template-docker-compose.yml
- name: Template config
ansible.builtin.template:
src: service.yml.j2
dest: "{{ (service_path, 'influxdb.yml') | path_join }}"
mode: "0600"
- import_tasks: steps/template-site-config.yml
- import_tasks: steps/start-service.yml

View file

@ -0,0 +1,72 @@
svc:
domain: "tick.serguzim.me"
name: influxdb
port: 8086
data_dir: "/var/lib/influxdb2"
svc_yml:
assets-path: ""
bolt-path: "{{ (svc.data_dir, 'influxd.bolt') | path_join }}"
e2e-testing: false
engine-path: "{{ (svc.data_dir, 'engine') | path_join }}"
feature-flags: {}
http-bind-address: 0.0.0.0:{{ svc.port }}
influxql-max-select-buckets: 0
influxql-max-select-point: 0
influxql-max-select-series: 0
key-name: ""
log-level: info
nats-max-payload-bytes: 1048576
nats-port: 4222
no-tasks: false
query-concurrency: 10
query-initial-memory-bytes: 0
query-max-memory-bytes: 0
query-memory-bytes: 9223372036854775807
query-queue-size: 10
reporting-disabled: false
secret-store: bolt
session-length: 60
session-renew-disabled: false
storage-cache-max-memory-size: 1073741824
storage-cache-snapshot-memory-size: 26214400
storage-cache-snapshot-write-cold-duration: 10m0s
storage-compact-full-write-cold-duration: 4h0m0s
storage-compact-throughput-burst: 50331648
storage-max-concurrent-compactions: 0
storage-max-index-log-file-size: 1048576
storage-retention-check-interval: 30m0s
storage-series-file-max-concurrent-snapshot-compactions: 0
storage-series-id-set-cache-size: 0
storage-shard-precreator-advance-period: 30m0s
storage-shard-precreator-check-interval: 10m0s
storage-tsm-use-madv-willneed: false
storage-validate-keys: false
storage-wal-fsync-delay: 0s
store: bolt
testing-always-allow-setup: false
tls-cert: ""
tls-key: ""
tls-min-version: "1.2"
tls-strict-ciphers: false
tracing-type: ""
vault-addr: ""
vault-cacert: ""
vault-capath: ""
vault-client-cert: ""
vault-client-key: ""
vault-client-timeout: 0s
vault-max-retries: 0
vault-skip-verify: false
vault-tls-server-name: ""
vault-token: ""
compose:
watchtower: false
image: influxdb
volumes:
- ./influxdb.yml:/etc/influxdb2/config.yml
- data:{{ svc.data_dir }}
file:
volumes:
data:

View file

@ -2,3 +2,6 @@
ansible.builtin.command: ansible.builtin.command:
cmd: docker compose up -d cmd: docker compose up -d
chdir: "{{ service_path }}" chdir: "{{ service_path }}"
when: "'local-dev' != inventory_hostname"
register: cmd_result
changed_when: "cmd_result.stderr | regex_search('Started$')"

View file

@ -1,5 +1,5 @@
{{ svc.domain }} { {{ svc.domain }} {
import default import default
{{ svc.caddy_extra | default('') | indent(width='\t') }} {{ svc.caddy_extra | default('') | indent(width='\t', first=True) }}
reverse_proxy {{ svc.name }}:{{ svc.port }} reverse_proxy {{ svc.name }}:{{ svc.port }}
} }

View file

@ -0,0 +1 @@
{{ svc_yml | to_nice_yaml }}

View file

@ -1,4 +0,0 @@
tick.serguzim.me {
import default
reverse_proxy influxdb:8086
}

View file

@ -1,4 +0,0 @@
wiki.serguzim.me {
import default
reverse_proxy wiki-js:3000
}

View file

@ -1,20 +0,0 @@
version: '3'
services:
influxdb:
image: influxdb:latest
volumes:
- ./influxdb.yml:/etc/influxdb2/config.yml
- data:/var/lib/influxdb2
restart: always
networks:
apps:
aliases:
- influxdb
volumes:
data:
networks:
apps:
external: true

View file

@ -1,55 +0,0 @@
assets-path: ""
bolt-path: /var/lib/influxdb2/influxd.bolt
e2e-testing: false
engine-path: /var/lib/influxdb2/engine
feature-flags: {}
http-bind-address: :8086
influxql-max-select-buckets: 0
influxql-max-select-point: 0
influxql-max-select-series: 0
key-name: ""
log-level: info
nats-max-payload-bytes: 1048576
nats-port: 4222
no-tasks: false
query-concurrency: 10
query-initial-memory-bytes: 0
query-max-memory-bytes: 0
query-memory-bytes: 9223372036854775807
query-queue-size: 10
reporting-disabled: false
secret-store: bolt
session-length: 60
session-renew-disabled: false
storage-cache-max-memory-size: 1073741824
storage-cache-snapshot-memory-size: 26214400
storage-cache-snapshot-write-cold-duration: 10m0s
storage-compact-full-write-cold-duration: 4h0m0s
storage-compact-throughput-burst: 50331648
storage-max-concurrent-compactions: 0
storage-max-index-log-file-size: 1048576
storage-retention-check-interval: 30m0s
storage-series-file-max-concurrent-snapshot-compactions: 0
storage-series-id-set-cache-size: 0
storage-shard-precreator-advance-period: 30m0s
storage-shard-precreator-check-interval: 10m0s
storage-tsm-use-madv-willneed: false
storage-validate-keys: false
storage-wal-fsync-delay: 0s
store: bolt
testing-always-allow-setup: false
tls-cert: ""
tls-key: ""
tls-min-version: "1.2"
tls-strict-ciphers: false
tracing-type: ""
vault-addr: ""
vault-cacert: ""
vault-capath: ""
vault-client-cert: ""
vault-client-key: ""
vault-client-timeout: 0s
vault-max-retries: 0
vault-skip-verify: false
vault-tls-server-name: ""
vault-token: ""