diff --git a/ansible/group_vars/database b/ansible/group_vars/database index d030435..61986f1 100644 --- a/ansible/group_vars/database +++ b/ansible/group_vars/database @@ -23,6 +23,8 @@ postgresql_users: password: "{{ lookup('hashi_vault', 'secret=secrets/data/database/paperless:password')}}" - name: dump password: "{{ lookup('hashi_vault', 'secret=secrets/data/database/dump:password')}}" + - name: vikunja + password: "{{ lookup('hashi_vault', 'secret=secrets/data/database/vikunja:password')}}" postgresql_databases: - name: wikijs @@ -43,4 +45,6 @@ postgresql_databases: owner: dendrite - name: paperless owner: paperless + - name: vikunja + owner: vikunja diff --git a/nomad-job/vikunja.nomad b/nomad-job/vikunja.nomad new file mode 100644 index 0000000..beebc96 --- /dev/null +++ b/nomad-job/vikunja.nomad @@ -0,0 +1,91 @@ + +job "vikunja" { + datacenters = ["homelab"] + priority = 50 + type = "service" + meta { + forcedeploy = "0" + } + + group "vikunja"{ + network { + mode = "host" + port "front" { + to = 80 + } + port "api" { + to = 3456 + } + } + vault{ + policies= ["vikunja"] + + } + task "api" { + driver = "docker" + service { + name = "vikunja-api" + port = "api" + tags = [ + "traefik.enable=true", + "traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.rule=Host(`${NOMAD_JOB_NAME}.ducamps.win`) && PathPrefix(`/api/v1`, `/dav/`, `/.well-known/`)", + "traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.tls.domains[0].sans=${NOMAD_JOB_NAME}.ducamps.win", + "traefik.http.routers.${NOMAD_JOB_NAME}-${NOMAD_TASK_NAME}.tls.certresolver=myresolver", + ] + } + config { + image = "vikunja/api" + ports = ["api"] + } + env { + VIKUNJA_DATABASE_HOST = "db1.ducamps.win" + VIKUNJA_DATABASE_TYPE = "postgres" + VIKUNJA_DATABASE_USER = "vikunja" + VIKUNJA_DATABASE_DATABASE = "vikunja" + VIKUNJA_SERVICE_JWTSECRET = uuidv4() + VIKUNJA_SERVICE_FRONTENDURL = "https://${NOMAD_JOB_NAME}.ducamps.win/" + } + + template { + data= <