From a27a157e22d539a8df35ce73532b1acfe4e5199e Mon Sep 17 00:00:00 2001 From: Tobias Reisinger <tobias@msrg.cc> Date: Fri, 31 Jan 2025 02:48:53 +0100 Subject: [PATCH] Add webdis service --- playbooks/roles/webdis/files/webdis.json | 31 ++++++++++++++++++++++++ playbooks/roles/webdis/tasks/main.yml | 20 +++++++++++++++ playbooks/roles/webdis/vars/main.yml | 23 ++++++++++++++++++ services.auto.tfvars | 14 +++++++++++ visualize.py | 1 + 5 files changed, 89 insertions(+) create mode 100644 playbooks/roles/webdis/files/webdis.json create mode 100644 playbooks/roles/webdis/tasks/main.yml create mode 100644 playbooks/roles/webdis/vars/main.yml diff --git a/playbooks/roles/webdis/files/webdis.json b/playbooks/roles/webdis/files/webdis.json new file mode 100644 index 0000000..25d95ac --- /dev/null +++ b/playbooks/roles/webdis/files/webdis.json @@ -0,0 +1,31 @@ +{ + "redis_host": "redis", + + "redis_port": 6379, + "redis_auth": null, + + "http_host": "0.0.0.0", + "http_port": 7379, + + "threads": 5, + "pool_size": 20, + + "daemonize": false, + "websockets": false, + + "database": 0, + + "acl": [ + { + "disabled": ["DEBUG"] + }, + + { + "http_basic_auth": "user:password", + "enabled": ["DEBUG"] + } + ], + + "verbosity": 4, + "logfile": "/dev/stderr" +} diff --git a/playbooks/roles/webdis/tasks/main.yml b/playbooks/roles/webdis/tasks/main.yml new file mode 100644 index 0000000..fb1561b --- /dev/null +++ b/playbooks/roles/webdis/tasks/main.yml @@ -0,0 +1,20 @@ +--- +- name: Set common facts + ansible.builtin.import_tasks: tasks/set-default-facts.yml + +- name: Deploy {{ role_name }} + vars: + svc: "{{ webdis_svc }}" + compose: "{{ webdis_compose }}" + block: + - name: Import prepare tasks for common service + ansible.builtin.import_tasks: tasks/prepare-common-service.yml + + - name: Copy the config + ansible.builtin.copy: + src: webdis.json + dest: "{{ (service_path, 'webdis.json') | path_join }}" + mode: "0755" + + - name: Import start tasks for common service + ansible.builtin.import_tasks: tasks/start-common-service.yml diff --git a/playbooks/roles/webdis/vars/main.yml b/playbooks/roles/webdis/vars/main.yml new file mode 100644 index 0000000..6a3ddfb --- /dev/null +++ b/playbooks/roles/webdis/vars/main.yml @@ -0,0 +1,23 @@ +--- +webdis_svc: + domain: "{{ all_services | service_get_domain(role_name) }}" + port: 7379 + +webdis_compose: + watchtower: update + image: nicolas/webdis + volumes: + - ./webdis.json:/config/webdis.json + file: + services: + app: + command: /usr/local/bin/webdis /config/webdis.json + depends_on: + - redis + redis: + image: redis:6.2.6 + restart: always + labels: + com.centurylinklabs.watchtower.enable: true + networks: + default: diff --git a/services.auto.tfvars b/services.auto.tfvars index c2bb2a7..c506628 100644 --- a/services.auto.tfvars +++ b/services.auto.tfvars @@ -681,6 +681,20 @@ services = { mail = "watchtower" }, + "webdis" = { + host = "node001" + dns = [{ + domain = "webdis.huck.serguzim.me" + }] + monitoring = { + url = "/info" + group = "4-services" + } + auth = false + database = false + s3 = false + }, + "wiki_js" = { host = "node001" dns = [{ diff --git a/visualize.py b/visualize.py index 62c8a43..a6b8c83 100755 --- a/visualize.py +++ b/visualize.py @@ -20,6 +20,7 @@ icon_overrides = { "tandoor": "tandoor-recipes", "teamspeak_fallback": None, "tinytinyrss": "tiny-tiny-rss", + "webdis": "redis", "wiki_js": "wiki-js", "woodpecker": None, }