Skip to content

Commit ef440e6

Browse files
committed
playbooks: allow specifying postgresql host
Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 03b2063 commit ef440e6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/playbooks/deploy-servers.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
prompt: "Instance name of the webserver"
55
default: patchew-server
66
private: no
7+
- name: db_host
8+
prompt: "Host for PostgreSQL database (empty = SQLite)"
9+
default: ""
10+
private: no
711
- name: superuser_name
812
prompt: "Admin account to create (optional)"
913
default: ""
@@ -16,7 +20,8 @@
1620
base_dir: "/data/{{ instance_name }}"
1721
src_dir: "{{ base_dir }}/src"
1822
data_dir: "{{ base_dir }}/data"
19-
docker_run_args: "--link {{ instance_name }}-db:patchew-db"
23+
db_arg: "{{ '-e PATCHEW_DB_PORT_5432_TCP_ADDR=' if db_host != '' else '' }}{{ db_host }}"
24+
docker_run_args: "--link {{ instance_name }}-db:patchew-db {{db_arg}}"
2025
tasks:
2126
- name: Create data dir
2227
file:

0 commit comments

Comments
 (0)