From 9016a38faa04218d8e63fd1da270f160234dcca8 Mon Sep 17 00:00:00 2001 From: Damien Arnodo Date: Sun, 1 Feb 2026 10:15:26 +0000 Subject: [PATCH] feat: add PostgreSQL password Secret block --- setup_blocks.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/setup_blocks.py b/setup_blocks.py index b80a529..5334a15 100644 --- a/setup_blocks.py +++ b/setup_blocks.py @@ -4,6 +4,7 @@ Setup Prefect Blocks from environment variables. import os from prefect_aws import AwsCredentials +from prefect.blocks.system import Secret def setup_blocks(): @@ -24,6 +25,14 @@ def setup_blocks(): print("✅ Block 'garage-credentials' created/updated") else: print("⚠️ Skipping garage-credentials: missing environment variables") + + # PostgreSQL password pour netbox + pg_password = os.environ.get("PG_PASSWORD") + if pg_password: + Secret(value=pg_password).save("netbox-db-password", overwrite=True) + print("✅ Block 'netbox-db-password' created/updated") + else: + print("⚠️ Skipping netbox-db-password: PG_PASSWORD not set") if __name__ == "__main__":