second commit
This commit is contained in:
25
ansible/roles/sqlite_init/tasks/main.yml
Normal file
25
ansible/roles/sqlite_init/tasks/main.yml
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
# Die Migrationen laufen bereits automatisch beim App-Start (app/db.py:init_db).
|
||||
# Diese Rolle stellt lediglich sicher, dass Verzeichnis/Rechte VOR dem ersten
|
||||
# Start korrekt sind und legt optional den initialen Admin-User an.
|
||||
|
||||
- name: Datenverzeichnis-Rechte sicherstellen
|
||||
ansible.builtin.file:
|
||||
path: "{{ jumphost_data_dir }}"
|
||||
state: directory
|
||||
owner: "{{ jumphost_app_user }}"
|
||||
group: "{{ jumphost_app_group }}"
|
||||
mode: "0700"
|
||||
|
||||
- name: Pruefen, ob bereits eine DB existiert
|
||||
ansible.builtin.stat:
|
||||
path: "{{ jumphost_data_dir }}/jumphost.db"
|
||||
register: _db_stat
|
||||
|
||||
- name: Hinweis fuer manuellen Erstadmin-Anlegeschritt ausgeben
|
||||
ansible.builtin.debug:
|
||||
msg: >
|
||||
Keine bestehende Datenbank gefunden. Nach dem ersten Start des Dienstes
|
||||
(Rolle jumphost_app) einmalig ausfuehren:
|
||||
{{ jumphost_venv }}/bin/python {{ jumphost_home }}/scripts/create_admin.py --username admin
|
||||
when: not _db_stat.stat.exists
|
||||
Reference in New Issue
Block a user