[Patchew-devel] [PATCH 3/5] playbooks: allow specifying postgresql host

Paolo Bonzini posted 5 patches 1 year, 2 months ago
[Patchew-devel] [PATCH 3/5] playbooks: allow specifying postgresql host
Posted by Paolo Bonzini 1 year, 2 months ago
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 scripts/playbooks/deploy-servers.yml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/playbooks/deploy-servers.yml b/scripts/playbooks/deploy-servers.yml
index 18acb36..12cddb8 100644
--- a/scripts/playbooks/deploy-servers.yml
+++ b/scripts/playbooks/deploy-servers.yml
@@ -4,6 +4,10 @@
       prompt: "Instance name of the webserver"
       default: patchew-server
       private: no
+    - name: db_host
+      prompt: "Host for PostgreSQL database (empty = SQLite)"
+      default: ""
+      private: no
     - name: superuser_name
       prompt: "Admin account to create (optional)"
       default: ""
@@ -16,7 +20,8 @@
     base_dir: "/data/{{ instance_name }}"
     src_dir: "{{ base_dir }}/src"
     data_dir: "{{ base_dir }}/data"
-    docker_run_args: "--link {{ instance_name }}-db:patchew-db"
+    db_arg: "{{ '-e PATCHEW_DB_PORT_5432_TCP_ADDR=' if db_host != '' else '' }}{{ db_host }}"
+    docker_run_args: "--link {{ instance_name }}-db:patchew-db {{db_arg}}"
   tasks:
     - name: Create data dir
       file:
-- 
2.38.1

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/patchew-devel