Skip to content

Commit

Permalink
add new parameters. Increase major version because some parameters ha…
Browse files Browse the repository at this point in the history
…ve dissapear
  • Loading branch information
cristifalcas committed Jan 20, 2017
1 parent 0388b3e commit 1982470
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 36 deletions.
65 changes: 34 additions & 31 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
# Whether you want to keep /usr/lib/systemd/system/docker.service.d/flannel.conf
# Defaults to true
#
# [*alsologtostderr*]
# log to standard error as well as files
# Defaults to false
## flanneld options
#
# [*public_ip*]
# IP accessible by other nodes for inter-host communication.
Expand Down Expand Up @@ -54,14 +52,14 @@
# Defaults to the interface for the default route on the machine.
# Defaults to ""
#
# [*subnet_dir*]
# directory where files with env variables (subnet, MTU, ...) will be written to
# Defaults to /run/flannel/networks
#
# [*subnet_file*]
# filename where env variables (subnet and MTU values) will be written to.
# Defaults to /run/flannel/subnet.env
#
# [*subnet_lease_renew_margin*]
# subnet lease renewal margin, in minutes.
# Defaults to undef
#
# [*ip_masq*]
# setup IP masquerade for traffic destined for outside the flannel network.
# Defaults to false
Expand Down Expand Up @@ -95,36 +93,41 @@
# if specified, will run in multi-network mode. Value is comma separate list of networks to join.
# Defaults to ""
#
# [*kube_subnet_mgr*]
# The Kubernetes API server can now be used as a datastore instead of etcd. This makes deployment easier as flannel
# no longer directly relies on the presence of an etcd server.
# Defaults to undef
#
# [*journald_forward_enable*]
# Enable log forwarding via journald_forward_enable
#
class flannel (
$ensure = $flannel::params::ensure,
$service_state = $flannel::params::service_state,
$service_enable = $flannel::params::service_enable,
$ensure = $flannel::params::ensure,
$service_state = $flannel::params::service_state,
$service_enable = $flannel::params::service_enable,
# flannel parameters
$manage_docker = $flannel::params::manage_docker,
$alsologtostderr = $flannel::params::alsologtostderr,
$public_ip = $flannel::params::public_ip,
$etcd_endpoints = $flannel::params::etcd_endpoints,
$etcd_prefix = $flannel::params::etcd_prefix,
$etcd_keyfile = $flannel::params::etcd_keyfile,
$etcd_certfile = $flannel::params::etcd_certfile,
$etcd_cafile = $flannel::params::etcd_cafile,
$iface = $flannel::params::iface,
$subnet_dir = $flannel::params::subnet_dir,
$subnet_file = $flannel::params::subnet_file,
$ip_masq = $flannel::params::ip_masq,
$listen = $flannel::params::listen,
$log_dir = $flannel::params::log_dir,
$remote = $flannel::params::remote,
$remote_keyfile = $flannel::params::remote_keyfile,
$remote_certfile = $flannel::params::remote_certfile,
$remote_cafile = $flannel::params::remote_cafile,
$networks = $flannel::params::networks,
$journald_forward_enable = $flannel::params::journald_forward_enable,
$manage_docker = $flannel::params::manage_docker,
$public_ip = $flannel::params::public_ip,
$etcd_endpoints = $flannel::params::etcd_endpoints,
$etcd_prefix = $flannel::params::etcd_prefix,
$etcd_keyfile = $flannel::params::etcd_keyfile,
$etcd_certfile = $flannel::params::etcd_certfile,
$etcd_cafile = $flannel::params::etcd_cafile,
$iface = $flannel::params::iface,
$subnet_lease_renew_margin = $flannel::params::subnet_lease_renew_margin,
$subnet_file = $flannel::params::subnet_file,
$ip_masq = $flannel::params::ip_masq,
$listen = $flannel::params::listen,
$log_dir = $flannel::params::log_dir,
$remote = $flannel::params::remote,
$remote_keyfile = $flannel::params::remote_keyfile,
$remote_certfile = $flannel::params::remote_certfile,
$remote_cafile = $flannel::params::remote_cafile,
$networks = $flannel::params::networks,
$kube_subnet_mgr = $flannel::params::kube_subnet_mgr,
$journald_forward_enable = $flannel::params::journald_forward_enable,
) inherits flannel::params {
validate_bool($service_enable, $manage_docker, $alsologtostderr, $journald_forward_enable)
validate_bool($service_enable, $manage_docker, $journald_forward_enable, $kube_subnet_mgr)

contain '::flannel::install'
contain '::flannel::config'
Expand Down
4 changes: 2 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
$etcd_certfile = undef
$etcd_keyfile = undef
$manage_docker = true
$alsologtostderr = false
$public_ip = undef
$iface = undef
$subnet_dir = '/run/flannel/networks'
$subnet_lease_renew_margin = undef
$subnet_file = '/run/flannel/subnet.env'
$ip_masq = false
$listen = undef
Expand All @@ -31,6 +30,7 @@
$remote_certfile = undef
$remote_cafile = undef
$networks = undef
$kube_subnet_mgr = undef

$journald_forward_enable = false
}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cristifalcas-flannel",
"version": "1.6.0",
"version": "2.0.0",
"author": "Cristian Falcas",
"license": "Apache-2.0",
"project_page": "https://github.com/cristifalcas/puppet-flannel",
Expand Down
8 changes: 6 additions & 2 deletions templates/sysconfig/flanneld.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ FLANNEL_ETCD_KEY="<%= scope['flannel::etcd_prefix'] %>"

# Any additional options that you want to pass
FLANNEL_OPTIONS="<% -%>
-alsologtostderr=<%= scope['flannel::alsologtostderr'] -%>
<% unless [nil, :undefined, :undef, ''].include?(scope['flannel::etcd_cafile']) and [nil, :undefined, :undef, ''].include?(scope['flannel::etcd_certfile']) and [nil, :undefined, :undef, ''].include?(scope['flannel::etcd_keyfile']) -%>
-etcd-cafile=<%= scope['flannel::etcd_cafile'] -%>
-etcd-certfile=<%= scope['flannel::etcd_certfile'] -%>
Expand Down Expand Up @@ -39,6 +38,11 @@ FLANNEL_OPTIONS="<% -%>
-remote-certfile=<%= scope['flannel::remote_certfile'] -%>
-remote-keyfile=<%= scope['flannel::remote_keyfile'] -%>
<% end -%>
-subnet-dir=<%= scope['flannel::subnet_dir'] -%>
<% unless [nil, :undefined, :undef, ''].include?(scope['flannel::subnet_lease_renew_margin']) -%>
-subnet-lease-renew-margin=<%= scope['flannel::subnet_lease_renew_margin'] -%>
<% end -%>
<% unless [nil, :undefined, :undef, ''].include?(scope['flannel::remote']) -%>
-kube-subnet-mgr=<%= scope['flannel::kube_subnet_mgr'] -%>
<% end -%>
-subnet-file=<%= scope['flannel::subnet_file'] -%>
"

0 comments on commit 1982470

Please sign in to comment.