Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
Add some missing parameters. Make package name a parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
cristifalcas committed Nov 22, 2016
1 parent 3062e07 commit f191d16
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 7 deletions.
31 changes: 26 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
# Passed to the docker package.
# Defaults to present
#
# [*package_name*]
# Set the etcd package name.
# Defaults to etcd
#
# [*manage_package*]
# If the module should manage the package
# Defaults to running
Expand Down Expand Up @@ -64,11 +68,6 @@
# respond to requests from any of the listed addresses and ports.
# default: "http://localhost:2380,http://localhost:7001"
#
# [*cluster_enabled*]
# If set to false, all clustering options will be omitted from the final config file. Fixes some problems
# with older etcd versions.
# default: true
#
# [*listen_client_urls*]
# List of URLs to listen on for client traffic. This flag tells the etcd to accept incoming requests
# from the clients on the specified scheme://IP:port combinations. Scheme can be either http or https.
Expand All @@ -91,6 +90,12 @@
# default: none
#
# cluster
#
# [*cluster_enabled*]
# If set to false, all clustering options will be omitted from the final config file. Fixes some problems
# with older etcd versions.
# default: true
#
# [*initial_advertise_peer_urls*]
# List of this member's peer URLs to advertise to the rest of the cluster. These addresses
# are used for communicating etcd data around the cluster. At least one must be routable to
Expand Down Expand Up @@ -135,6 +140,10 @@
# Reject reconfiguration requests that would cause quorum loss.
# default: false
#
# [*auto_compaction_retention*]
# Auto compaction retention for mvcc key value store in hour. 0 means disable auto compaction. Defaults to 0
# default: undef
#
# proxy
# [*proxy*]
# Proxy mode setting ("off", "readonly" or "on").
Expand Down Expand Up @@ -178,6 +187,10 @@
# Path to the client server TLS trusted CA key file.
# default: none
#
# [*auto_tls*]
# Client TLS using generated certificates. Defaults to false
# default: none
#
# [*peer_cert_file*]
# Path to the peer server TLS cert file.
# default: none
Expand All @@ -194,6 +207,10 @@
# Path to the peer server TLS trusted CA file.
# default: none
#
# [*peer_auto_tls*]
# Peer TLS using generated certificates. Defaults to false
# default: none
#
# logging
# [*debug*]
# Drop the default log level to DEBUG for all subpackages.
Expand All @@ -208,6 +225,7 @@
#
class etcd (
$ensure = $etcd::params::ensure,
$package_name = $etcd::params::package_name,
$manage_package = $etcd::params::manage_package,
$manage_service = $etcd::params::manage_service,
$config_file_path = $etcd::params::config_file_path,
Expand Down Expand Up @@ -237,6 +255,7 @@
$discovery_fallback = $etcd::params::discovery_fallback,
$discovery_proxy = $etcd::params::discovery_proxy,
$strict_reconfig_check = $etcd::params::strict_reconfig_check,
$auto_compaction_retention = $etcd::params::auto_compaction_retention,
# proxy
$proxy = $etcd::params::proxy,
$proxy_failure_wait = $etcd::params::proxy_failure_wait,
Expand All @@ -249,10 +268,12 @@
$key_file = $etcd::params::key_file,
$client_cert_auth = $etcd::params::client_cert_auth,
$trusted_ca_file = $etcd::params::trusted_ca_file,
$auto_tls = $etcd::params::auto_tls,
$peer_cert_file = $etcd::params::peer_cert_file,
$peer_key_file = $etcd::params::peer_key_file,
$peer_client_cert_auth = $etcd::params::peer_client_cert_auth,
$peer_trusted_ca_file = $etcd::params::peer_trusted_ca_file,
$peer_auto_tls = $etcd::params::peer_auto_tls,
# logging
$debug = $etcd::params::debug,
$log_package_levels = $etcd::params::log_package_levels,
Expand Down
2 changes: 1 addition & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
#
class etcd::install {
if $::etcd::manage_package {
package { 'etcd': ensure => $::etcd::ensure, }
package { $::etcd::package_name: ensure => $::etcd::ensure, }
}
}
4 changes: 4 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
class etcd::params {
$ensure = 'present'
$package_name = 'etcd'
$manage_package = true
$manage_service = true

Expand Down Expand Up @@ -47,6 +48,7 @@
$discovery_fallback = 'proxy'
$discovery_proxy = undef
$strict_reconfig_check = false
$auto_compaction_retention = undef

# proxy
$proxy = undef
Expand All @@ -61,10 +63,12 @@
$key_file = undef
$client_cert_auth = false
$trusted_ca_file = undef
$auto_tls = undef
$peer_cert_file = undef
$peer_key_file = undef
$peer_client_cert_auth = false
$peer_trusted_ca_file = undef
$peer_auto_tls = undef

# logging
$debug = false
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cristifalcas-etcd",
"version": "1.8.0",
"version": "1.9.0",
"author": "Cristian Falcas",
"summary": "Installs and configures etcd",
"license": "Apache-2.0",
Expand Down
9 changes: 9 additions & 0 deletions templates/etc/etcd/etcd.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ ETCD_DISCOVERY_FALLBACK="<%= scope['etcd::discovery_fallback'] %>"
ETCD_DISCOVERY_PROXY="<%= scope['etcd::discovery_proxy'] %>"
<% end -%>
ETCD_STRICT_RECONFIG_CHECK=<%= scope['etcd::strict_reconfig_check'] %>
<% unless [nil, :undefined, :undef, ''].include?(scope['etcd::auto_compaction_retention']) -%>
ETCD_AUTO_COMPACTION_RETENTION="<%= scope['etcd::auto_compaction_retention'] %>"
<% end -%>
#
<% end %>
#[security]
Expand All @@ -56,6 +59,9 @@ ETCD_CLIENT_CERT_AUTH=<%= scope['etcd::client_cert_auth'] %>
<% unless [nil, :undefined, :undef, ''].include?(scope['etcd::trusted_ca_file']) -%>
ETCD_TRUSTED_CA_FILE="<%= scope['etcd::trusted_ca_file'] %>"
<% end -%>
<% unless [nil, :undefined, :undef, ''].include?(scope['etcd::auto_tls']) -%>
ETCD_AUTO_TLS="<%= scope['etcd::auto_tls'] %>"
<% end -%>
<% unless [nil, :undefined, :undef, ''].include?(scope['etcd::peer_cert_file']) -%>
ETCD_PEER_CERT_FILE="<%= scope['etcd::peer_cert_file'] %>"
<% end -%>
Expand All @@ -66,6 +72,9 @@ ETCD_PEER_CLIENT_CERT_AUTH=<%= scope['etcd::peer_client_cert_auth'] %>
<% unless [nil, :undefined, :undef, ''].include?(scope['etcd::peer_trusted_ca_file']) -%>
ETCD_PEER_TRUSTED_CA_FILE="<%= scope['etcd::peer_trusted_ca_file'] %>"
<% end -%>
<% unless [nil, :undefined, :undef, ''].include?(scope['etcd::peer_auto_tls']) -%>
ETCD_PEER_AUTO_TLS="<%= scope['etcd::peer_auto_tls'] %>"
<% end -%>
#
#[logging]
ETCD_DEBUG=<%= scope['etcd::debug'] %>
Expand Down

0 comments on commit f191d16

Please sign in to comment.