diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-05-04 23:45:05 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-05-04 23:45:05 +0200 |
commit | eeac44ec8e07980b3dcdb0789666db17f3e23ea2 (patch) | |
tree | cec31af0dd8514c7cfd512efef5e67cca73a7524 /modules/role | |
parent | 6b449ef816a70162c90f8d215e25fe2970a891bc (diff) | |
download | Puppet-eeac44ec8e07980b3dcdb0789666db17f3e23ea2.tar.gz Puppet-eeac44ec8e07980b3dcdb0789666db17f3e23ea2.tar.zst Puppet-eeac44ec8e07980b3dcdb0789666db17f3e23ea2.zip |
Handle postgresql sockets for cryptoportfolio app
Diffstat (limited to 'modules/role')
-rw-r--r-- | modules/role/manifests/cryptoportfolio.pp | 2 | ||||
-rw-r--r-- | modules/role/templates/cryptoportfolio/api_conf.toml.erb | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/modules/role/manifests/cryptoportfolio.pp b/modules/role/manifests/cryptoportfolio.pp index 966f549..5aaaee3 100644 --- a/modules/role/manifests/cryptoportfolio.pp +++ b/modules/role/manifests/cryptoportfolio.pp | |||
@@ -7,7 +7,7 @@ class role::cryptoportfolio ( | |||
7 | String $pg_user, | 7 | String $pg_user, |
8 | String $pg_user_replication, | 8 | String $pg_user_replication, |
9 | String $pg_db, | 9 | String $pg_db, |
10 | Optional[String] $pg_hostname = "localhost", | 10 | Optional[String] $pg_hostname = "/run/postgresql", |
11 | Optional[String] $pg_port = "5432", | 11 | Optional[String] $pg_port = "5432", |
12 | Optional[String] $redis_host = "/run/redis/redis.sock", | 12 | Optional[String] $redis_host = "/run/redis/redis.sock", |
13 | Optional[String] $web_host = undef, | 13 | Optional[String] $web_host = undef, |
diff --git a/modules/role/templates/cryptoportfolio/api_conf.toml.erb b/modules/role/templates/cryptoportfolio/api_conf.toml.erb index 63f39c7..d806778 100644 --- a/modules/role/templates/cryptoportfolio/api_conf.toml.erb +++ b/modules/role/templates/cryptoportfolio/api_conf.toml.erb | |||
@@ -6,7 +6,13 @@ log_out="stdout" | |||
6 | user="<%= @pg_user %>" | 6 | user="<%= @pg_user %>" |
7 | password="<%= @pg_password %>" | 7 | password="<%= @pg_password %>" |
8 | database="<%= @pg_db %>" | 8 | database="<%= @pg_db %>" |
9 | address="<%= @pg_host %>" | 9 | <%- if @pg_hostname[0] == "/" -%> |
10 | type="unix" | ||
11 | address="<%= @pg_hostname %>/.s.PGSQL.<%= @pg_port %>" | ||
12 | <%- else -%> | ||
13 | type="tcp" | ||
14 | address="<%= @pg_hostname %>:<%= @pg_port %>" | ||
15 | <%- end -%> | ||
10 | 16 | ||
11 | <%- if !@redis_host.nil? && @redis_host != "" -%> | 17 | <%- if !@redis_host.nil? && @redis_host != "" -%> |
12 | [redis] | 18 | [redis] |