Add support to configure PostgreSQL as DataSource
Change-Id: Ib005a4df3f22ed3cb15f7b86f818ecf51b7214f9
diff --git a/rundeck/files/rundeck-config.properties b/rundeck/files/rundeck-config.properties
index 66a7681..78764ca 100644
--- a/rundeck/files/rundeck-config.properties
+++ b/rundeck/files/rundeck-config.properties
@@ -8,5 +8,12 @@
loglevel.default=INFO
rss.enabled=false
+{%- if server.datasource is defined and server.datasource.engine == 'postgresql' %}
+dataSource.driverClassName = org.postgresql.Driver
+dataSource.url = jdbc:postgresql://{{ server.datasource.host }}:{{ server.datasource.port }}/{{ server.datasource.database|default("rundeck") }}
+dataSource.username = {{ server.datasource.username }}
+dataSource.password = {{ server.datasource.password }}
+{%- else %}
dataSource.dbCreate = update
dataSource.url = jdbc:h2:file:/var/lib/rundeck/data/rundeckdb;MVCC=true
+{%- endif %}