Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Fixes for Systemd- and Postgress-Config #20

Open
wants to merge 7 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
validate_array($custom_plugins)
validate_re($database, '^(cassandra|postgres)$', "${module_name}: Database must be cassandra or postgres.")
validate_string($dns_resolver)
validate_hash($dns_resolvers_available)
# validate_hash($dns_resolvers_available)
validate_absolute_path($kong_path)
validate_absolute_path($kong_prefix)
validate_string($log_level)
Expand Down
2 changes: 1 addition & 1 deletion manifests/initscripts.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}

$_init_script_file_path = $::service_provider ? {
'systemd' => "${systemd::systemd_unit_path}/kong.service",
'systemd' => "${systemd_unit_path}/kong.service",
'upstart' => '/etc/init/kong.conf',
default => '/etc/init.d/kong',
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
} else {

# Install package from your local repository using the native package provider
package { 'kong:':
package { 'kong':
ensure => $kong::version,
}
}

}

}
}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
},
{
"name": "puppetlabs/stdlib",
"version_requirement": ">=4.6.0 <5.0.0"
"version_requirement": ">=4.12.0 <5.0.0"
},
{
"name": "camptocamp/systemd",
Expand Down
12 changes: 6 additions & 6 deletions templates/init/systemd/kong.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Description=Kong daemon

[Service]
<%- if !@nginx_conf.nil? -%>
ExecStart=<%= @kong_path -%> start --conf @config_file_path --nginx-conf @nginx_conf
ExecReload=<% @kong_path -%> reload --conf @config_file_path --nginx-conf @nginx_conf
ExecStart=<%= @kong_path -%> start --conf <%= @config_file_path -%> --nginx-conf <%= @nginx_conf %>
ExecReload=<%= @kong_path -%> reload --conf <%= @config_file_path -%> --nginx-conf <%= @nginx_conf %>
<% else -%>
ExecStart=<%= @kong_path -%> start --conf @config_file_path
ExecReload=<% @kong_path -%> reload --conf @config_file_path --nginx-conf
ExecStart=<%= @kong_path -%> start --conf <%= @config_file_path %>
ExecReload=<%= @kong_path -%> reload --conf <%= @config_file_path %>
<%- end -%>
ExecStop<%= @kong_path -%> stop
Restart=on-failure
ExecStop=<%= @kong_path -%> stop
Restart=on-failure
18 changes: 9 additions & 9 deletions templates/kong.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ ssl_cert = <%= @ssl_cert -%>
<% end -%>

<% if @ssl_cert_key -%>
ssl_key_path = <%= @ssl_cert_key -%>
ssl_cert_key = <%= @ssl_cert_key -%>
<% end -%>

database = <%= @database -%>

<% if @database == 'postgres' -%>
pg_host = <%= @pg_host -%>
pg_host = <%= @pg_host %>
pg_port = <%= @pg_port %>
pg_user = <%= @pg_user -%>
pg_password = <%= @pg_password -%>
pg_database = <%= @pg_database -%>
pg_ssl = <%= @pg_ssl -%>
pg_ssl_verify = <%= @pg_ssl_verify -%>
pg_user = <%= @pg_user %>
pg_password = <%= @pg_password %>
pg_database = <%= @pg_database %>
pg_ssl = <%= @pg_ssl %>
pg_ssl_verify = <%= @pg_ssl_verify %>
<% end -%>

<% if @database == 'cassandra' -%>
Expand Down Expand Up @@ -85,9 +85,9 @@ cluster_ttl_on_failure = <%= @cluster_ttl_on_failure %>

cluster_profile = <%= @cluster_profile %>

dnsmasq = <%= @dnsmasq -%>
dnsmasq = <%= @dnsmasq %>
<% if @dnsmasq -%>
dnsmasq_port = <%= @dnsmasq_port -%>
dnsmasq_port = <%= @dnsmasq_port %>
<% end -%>

<% if ! @dnsmasq -%>
Expand Down