feat: add PostgreSQL password Secret block
Some checks failed
Deploy Prefect Flows / deploy (push) Has been cancelled
Some checks failed
Deploy Prefect Flows / deploy (push) Has been cancelled
This commit is contained in:
@@ -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():
|
||||||
@@ -24,6 +25,14 @@ def setup_blocks():
|
|||||||
print("✅ Block 'garage-credentials' created/updated")
|
print("✅ Block 'garage-credentials' created/updated")
|
||||||
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__":
|
||||||
|
|||||||
Reference in New Issue
Block a user