Add semaphoreui
This commit is contained in:
parent
de28962803
commit
5cd57e1831
3 changed files with 92 additions and 0 deletions
56
playbooks/roles/semaphoreui/defaults/main.yml
Normal file
56
playbooks/roles/semaphoreui/defaults/main.yml
Normal 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
|
||||
3
playbooks/roles/semaphoreui/handlers/main.yml
Normal file
3
playbooks/roles/semaphoreui/handlers/main.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
- name: Restart service semaphoreui
|
||||
ansible.builtin.include_tasks: tasks/restart-service.yml
|
||||
22
playbooks/roles/semaphoreui/tasks/main.yml
Normal file
22
playbooks/roles/semaphoreui/tasks/main.yml
Normal 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
|
||||
Loading…
Reference in a new issue