Greg Karékinian 2c21d6255b Add PostgreSQL primary support to the kosmos-ejabberd cookbook
* Move the PostgreSQL user and database creation to a pg_db recipe
* Generate access rights for the ejabberd servers in the pg_db recipe
* Connect to the PostgreSQL primary instead of localhost

Refs #180
2020-06-10 18:38:40 +02:00

29 lines
1019 B
Plaintext

# Generated by Chef for <%= @host[:name] %>
<% if File.exist?("/opt/ejabberd/conf/#{@host[:name]}.crt") && File.exist?("/opt/ejabberd/conf/#{@host[:name]}.key") -%>
certfiles:
- "/opt/ejabberd/conf/<%= @host[:name] %>.crt"
- "/opt/ejabberd/conf/<%= @host[:name] %>.key"
<% end -%>
host_config:
"<%= @host[:name] %>":
sql_type: pgsql
sql_server: "<%= @sql_server %>"
sql_database: "<%= @host[:sql_database] %>"
sql_username: "ejabberd"
sql_password: "<%= @pgsql_password %>"
<% if @host[:ldap_enabled] -%>
auth_method: ldap
ldap_servers: ["<%= @ldap_server %>"]
ldap_rootdn: "<%= @ldap_rootdn %>"
ldap_password: "<%= @host[:ldap_password] %>"
ldap_encrypt: <%= @ldap_encryption_type %>
ldap_tls_verify: hard # when TLS is enabled, don't proceed if a cert is invalid
ldap_base: "ou=<%= @host[:name] %>,<%= @ldap_base %>"
ldap_filter: "(objectClass=person)"
<% end -%>
append_host_config:
"<%= @host[:name] %>":
<%= @host[:append_host_config].chomp %>