diff --git a/roles/trade_hub/README.md b/roles/trade_hub/README.md index d1b4b16..4919854 100644 --- a/roles/trade_hub/README.md +++ b/roles/trade_hub/README.md @@ -40,8 +40,11 @@ node): trade_hub_postgres_password: "choose-something-strong" ``` -If it is omitted, the role falls back to `POSTGRES_PASSWORD` from the control -node environment, then to the development default `sc_inventory_dev`. +If it is omitted, the role falls back to the play variable `POSTGRES_PASSWORD`, +then to `POSTGRES_PASSWORD` from the control node environment, then to the +development default `sc_inventory_dev`. If the password contains characters +that are significant in a URL (`@`, `:`, `/`, …), set `trade_hub_database_url` +explicitly as well. ## Common variables @@ -57,7 +60,7 @@ node environment, then to the development default `sc_inventory_dev`. | `trade_hub_postgres_image` | `docker.io/library/postgres:16-alpine` | Database image | | `trade_hub_postgres_user` | `sc_inventory` | Database user | | `trade_hub_postgres_db` | `sc_inventory` | Database name | -| `trade_hub_postgres_password` | env `POSTGRES_PASSWORD` or `sc_inventory_dev` | Database password | +| `trade_hub_postgres_password` | play var/env `POSTGRES_PASSWORD` or `sc_inventory_dev` | Database password | | `trade_hub_network` | `sc-inventory` | Podman network name | | `trade_hub_volume` | `sc-inventory-data` | PostgreSQL data volume | | `trade_hub_frontend_bind` | `0.0.0.0` | Address the frontend publishes on | diff --git a/roles/trade_hub/defaults/main.yml b/roles/trade_hub/defaults/main.yml index 3dc7ce9..7ac3a7b 100644 --- a/roles/trade_hub/defaults/main.yml +++ b/roles/trade_hub/defaults/main.yml @@ -24,7 +24,7 @@ trade_hub_frontend_container: sc-inventory-frontend # Database. trade_hub_postgres_user: sc_inventory trade_hub_postgres_db: sc_inventory -trade_hub_postgres_password: "{{ lookup('env', 'POSTGRES_PASSWORD') | default('sc_inventory_dev', true) }}" +trade_hub_postgres_password: "{{ POSTGRES_PASSWORD | default(lookup('env', 'POSTGRES_PASSWORD'), true) | default('sc_inventory_dev', true) }}" trade_hub_database_url: "postgresql+psycopg://{{ trade_hub_postgres_user }}:{{ trade_hub_postgres_password }}@db:5432/{{ trade_hub_postgres_db }}" trade_hub_db_wait_seconds: 60 diff --git a/roles/trade_hub/tasks/main.yml b/roles/trade_hub/tasks/main.yml index e8e7752..b374964 100644 --- a/roles/trade_hub/tasks/main.yml +++ b/roles/trade_hub/tasks/main.yml @@ -31,7 +31,6 @@ podman is not installed on {{ inventory_hostname }}. Install it first (for example with the "packages" role) or run this role with -e trade_hub_install_podman=true. - quiet: true - name: Remove the legacy Apache container when requested containers.podman.podman_container: @@ -122,7 +121,6 @@ trade_hub_build_images is false but {{ trade_hub_backend_image }}:{{ trade_hub_image_tag }} and/or {{ trade_hub_frontend_image }}:{{ trade_hub_image_tag }} are missing on {{ inventory_hostname }}. - quiet: true when: not trade_hub_build_images | bool - name: Record whether the application containers need to be recreated