updated view and database

This commit is contained in:
ske087
2026-06-24 15:21:40 +03:00
parent cb12a8f1cf
commit a48b3afb83
14 changed files with 372 additions and 205 deletions
+8 -1
View File
@@ -27,7 +27,7 @@ class AnsibleService:
}
def __init__(self):
self.db = get_db()
self._db = None
self.ansible_dir = Path("ansible")
self.inventory_file = self.ansible_dir / "inventory" / "dynamic_inventory.yaml"
self.playbook_dir = self.ansible_dir / "playbooks"
@@ -42,6 +42,13 @@ class AnsibleService:
(self.ansible_dir / "roles").mkdir(exist_ok=True)
self.ssh_keys_dir.mkdir(mode=0o700, exist_ok=True)
@property
def db(self):
"""Lazily resolve the database handle (see LogCompressionService.db)."""
if self._db is None:
self._db = get_db()
return self._db
# ------------------------------------------------------------------ #
# Settings helpers #
# ------------------------------------------------------------------ #