Add semaphoreui

This commit is contained in:
Tobias Reisinger 2026-10-28 10:47:37 +01:00
commit 5cd57e1831
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
4 changed files with 92 additions and 0 deletions

View file

@ -0,0 +1,56 @@
---
semaphoreui_cookie_hash: "{{ undef() }}"
semaphoreui_cookie_encryption: "{{ undef() }}"
semaphoreui_access_key_encryption: "{{ undef() }}"
semaphoreui_svc:
domain: "{{ all_services | service_get_domain(service_name) }}"
port: 3000
semaphoreui_config:
dialect: postgres
postgres:
host: "{{ postgres.host }}"
user: "{{ opentofu.postgresql_data.semaphoreui.user }}"
pass: "{{ opentofu.postgresql_data.semaphoreui.pass }}"
name: "{{ opentofu.postgresql_data.semaphoreui.database }}"
options:
sslmode: require
schedule:
timezone: "{{ timezone }}"
email_alert: true
email_sender: "{{ opentofu.mailcow_data.semaphoreui.address }}"
email_host: "{{ mailer.host }}"
email_port: "{{ mailer.port }}"
email_username: "{{ opentofu.mailcow_data.semaphoreui.address }}"
email_password: "{{ opentofu.mailcow_data.semaphoreui.password }}"
email_secure: true
cookie_hash: "{{ semaphoreui_cookie_hash | mandatory }}"
cookie_encryption: "{{ semaphoreui_cookie_encryption | mandatory }}"
access_key_encryption: "{{ semaphoreui_access_key_encryption | mandatory }}"
oidc_providers:
authentik:
display_name: "Sign in with Authentik"
provider_url: "{{ opentofu.authentik_data.semaphoreui.base_url }}/"
client_id: "{{ opentofu.authentik_data.semaphoreui.client_id }}"
client_secret: "{{ opentofu.authentik_data.semaphoreui.client_secret }}"
redirect_url: "https://{{ semaphoreui_svc.domain }}/api/auth/oidc/authentik/redirect/"
scopes:
- openid
- profile
- email
username_claim: "preferred_username"
name_claim: "preferred_username"
semaphoreui_env:
TZ: "{{ timezone }}"
semaphoreui_compose:
watchtower: update
image: semaphoreui/semaphore:latest
volumes:
- ./config.json:/etc/semaphore/config.json

View file

@ -0,0 +1,3 @@
---
- name: Restart service semaphoreui
ansible.builtin.include_tasks: tasks/restart-service.yml

View file

@ -0,0 +1,22 @@
---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ service_name }}
vars:
svc: "{{ semaphoreui_svc }}"
env: "{{ semaphoreui_env }}"
compose: "{{ semaphoreui_compose }}"
block:
- name: Import prepare tasks for common service
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
- name: Create config
ansible.builtin.copy:
dest: "{{ (service_path, 'config.json') | path_join }}"
content: '{{ semaphoreui_config | to_nice_json }}'
mode: "0644"
notify: Restart service {{ service_name }}
- name: Import start tasks for common service
ansible.builtin.import_tasks: tasks/start-common-service.yml

View file

@ -648,6 +648,17 @@ services = {
database = false database = false
}, },
"semaphoreui" = {
host = "node002"
dns = [{
domain = "automation.serguzim.me"
}]
database = true
auth = true
auth_redirects = ["https://automation.serguzim.me/api/auth/oidc/authentik/redirect/"]
mail = "automation@serguzim.me"
}
"shlink" = { "shlink" = {
host = "node001" host = "node001"
dns = [ dns = [