diff --git a/manifests/config.pp b/manifests/config.pp index 4cbe4d1..b1cde5d 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -7,15 +7,15 @@ } if $flannel::manage_docker { - $service_flannel_ensure = 'file' + $docker_dropin_ensure = 'file' include ::docker File['/usr/lib/systemd/system/docker.service.d/flannel.conf'] ~> Service['flanneld'] ~> Service['docker'] } else { - $service_flannel_ensure = 'absent' + $docker_dropin_ensure = 'absent' } file { '/usr/lib/systemd/system/docker.service.d/flannel.conf': - ensure => $service_flannel_ensure, + ensure => $docker_dropin_ensure, content => template("${module_name}/service_flannel.conf"), mode => '0644', } ~> diff --git a/manifests/params.pp b/manifests/params.pp index 9d9406b..7262783 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -7,11 +7,6 @@ $manage_docker = true $alsologtostderr = false $public_ip = undef - $etcd_endpoints = 'http://127.0.0.1:4001' - $etcd_prefix = '/coreos.com/network' - $etcd_keyfile = undef - $etcd_certfile = undef - $etcd_cafile = undef $iface = undef $subnet_dir = '/run/flannel/networks' $subnet_file = '/run/flannel/subnet.env' @@ -24,6 +19,11 @@ $remote_cafile = undef $networks = undef + $etcd_endpoints = 'http://127.0.0.1:4001' + $etcd_prefix = '/coreos.com/network' + $etcd_keyfile = undef + $etcd_certfile = undef + $etcd_cafile = undef $configure_etcd = false $network = '10.0.0.0/8' $subnetlen = undef diff --git a/metadata.json b/metadata.json index 09b1351..63962d8 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "cristifalcas-flannel", - "version": "0.10.0", + "version": "1.0.0", "author": "Cristian Falcas", "license": "Apache-2.0", "project_page": "https://github.com/cristifalcas/puppet-flannel", @@ -35,7 +35,7 @@ "requirements": [], "dependencies": [{ "name": "cristifalcas/etcd", - "version_requirement": "0.x" + "version_requirement": "1.x" },{ "name": "cristifalcas/docker", "version_requirement": "5.x" diff --git a/templates/etcd_network_definition.erb b/templates/etcd_network_definition.erb index 11a8742..ca1ea84 100644 --- a/templates/etcd_network_definition.erb +++ b/templates/etcd_network_definition.erb @@ -1,24 +1,25 @@ { "Network": "<%= scope['flannel::network'] %>"<% -%> <% if @subnetlen then -%>, - "SubnetLen": <%= scope['flannel::subnetlen'] %> + "SubnetLen": <%= scope['flannel::subnetlen'] -%> <% end -%> <% if @subnetmin then -%>, - "SubnetMin": "<%= scope['flannel::subnetmin'] %>" + "SubnetMin": "<%= scope['flannel::subnetmin'] %>"<% -%> <% end -%> <% if @subnetmax then -%>, - "SubnetMax": "<%= scope['flannel::subnetmax'] %>" + "SubnetMax": "<%= scope['flannel::subnetmax'] %>"<% -%> <% end -%> <% if @backend_type && @backend_port then -%>, "Backend": { - "Type": "<%= scope['flannel::backend_type'] %>" + "Type": "<%= scope['flannel::backend_type'] %>"<% -%> <% if @backend_type == 'udp' then -%>, - "Port": <%= scope['flannel::backend_port'] %> + "Port": <%= scope['flannel::backend_port'] -%> <% elsif @backend_type == 'vxlan' -%>, - "VNI": <%= scope['flannel::backend_port'] %> + "VNI": <%= scope['flannel::backend_port'] -%> <% elsif @backend_type == 'aws-vpc' -%>, - "RouteTableID": <%= scope['flannel::backend_port'] %> + "RouteTableID": <%= scope['flannel::backend_port'] -%> <% end -%> + } <% end -%> }