feat: add PostgreSQL password Secret block
Some checks failed
Deploy Prefect Flows / deploy (push) Has been cancelled

This commit is contained in:
2026-02-01 10:15:26 +00:00
parent 66118b9fa4
commit 9016a38faa

View File

@@ -4,6 +4,7 @@ Setup Prefect Blocks from environment variables.
import os import os
from prefect_aws import AwsCredentials from prefect_aws import AwsCredentials
from prefect.blocks.system import Secret
def setup_blocks(): def setup_blocks():
@@ -25,6 +26,14 @@ def setup_blocks():
else: else:
print("⚠️ Skipping garage-credentials: missing environment variables") 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__": if __name__ == "__main__":
setup_blocks() setup_blocks()