From c8ee7d9fa2b497b3cac8b332632d72c6da97c33a Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Fri, 18 Mar 2016 16:01:52 -0700 Subject: [PATCH] Lint fixes --- README.md | 2 -- manifests/backend.pp | 6 +++--- manifests/peer.pp | 17 ++++++++--------- manifests/peers.pp | 4 ++-- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index e21d61eb..e40083ac 100644 --- a/README.md +++ b/README.md @@ -729,8 +729,6 @@ Sets up a peer entry inside the peers configuration block in haproxy.cfg. ##### Parameters -* `ensure`: Specifies whether the peer should exist in the configuration block. Valid options: 'present' or 'absent'. Default: 'present'. - * `ipaddresses`: *Required unless the `collect_exported` parameter of your `haproxy::peers` resource is set to `true`.* Specifies the IP address used to contact the peer member server. Valid options: a string or an array. If you pass an array, it must contain the same number of elements as the array you pass to the `server_names` parameter. Puppet pairs up the elements from both arrays and creates a peer for each pair of values. Default: the value of the `$::ipaddress` fact. * `peers_name`: *Required.* Specifies the peer in which to add the load balancer. Valid options: a string containing the name of an HAProxy peer. diff --git a/manifests/backend.pp b/manifests/backend.pp index af55823c..a2d5a4a8 100644 --- a/manifests/backend.pp +++ b/manifests/backend.pp @@ -64,7 +64,7 @@ 'option' => [ 'tcplog', ], - 'balance' => 'roundrobin' + 'balance' => 'roundrobin', }, $instance = 'haproxy', $section_name = $name, @@ -74,7 +74,7 @@ fail("An haproxy::listen resource was discovered with the same name (${section_name}) which is not supported") } - include haproxy::params + include ::haproxy::params if $instance == 'haproxy' { $instance_name = 'haproxy' $config_file = $haproxy::params::config_file @@ -82,7 +82,7 @@ $instance_name = "haproxy-${instance}" $config_file = inline_template($haproxy::params::config_file_tmpl) } - include haproxy::globals + include ::haproxy::globals $_sort_options_alphabetic = pick($sort_options_alphabetic, $haproxy::globals::sort_options_alphabetic) # Template uses: $section_name, $ipaddress, $ports, $options diff --git a/manifests/peer.pp b/manifests/peer.pp index 69e81c61..6fb6e10f 100644 --- a/manifests/peer.pp +++ b/manifests/peer.pp @@ -20,10 +20,6 @@ # ipaddresses parameter's array. A peer is created for each pair # of server\_names and ipaddresses in the array. # -# [*ensure*] -# Whether to add or remove the peer. Defaults to 'present'. -# Valid values are 'present' and 'absent'. -# # [*ipaddresses*] # Specifies the IP address used to contact the peer member server. # Can be an array. If this parameter is specified as an array it @@ -36,13 +32,17 @@ define haproxy::peer ( $peers_name, $port, - $ensure = 'present', $server_names = $::hostname, $ipaddresses = $::ipaddress, - $instance = 'haproxy', -) { + $instance = 'haproxy', - include haproxy::params + #Deprecated + $ensure = undef, +) { + if $ensure { + warning('ensure is deprecated') + } + include ::haproxy::params if $instance == 'haproxy' { $instance_name = 'haproxy' $config_file = $::haproxy::config_file @@ -53,7 +53,6 @@ # Templates uses $ipaddresses, $server_name, $ports, $option concat::fragment { "${instance_name}-peers-${peers_name}-${name}": - ensure => $ensure, order => "30-peers-01-${peers_name}-${name}", target => $config_file, content => template('haproxy/haproxy_peer.erb'), diff --git a/manifests/peers.pp b/manifests/peers.pp index b227cee9..ffaf4be6 100644 --- a/manifests/peers.pp +++ b/manifests/peers.pp @@ -18,7 +18,7 @@ ) { # We derive these settings so that the caller only has to specify $instance. - include haproxy::params + include ::haproxy::params if $instance == 'haproxy' { $instance_name = 'haproxy' $config_file = $::haproxy::config_file @@ -27,7 +27,7 @@ $config_file = inline_template($haproxy::params::config_file_tmpl) } - # Template uses: $name, $ipaddress, $ports, $options + # Template uses: $name concat::fragment { "${instance_name}-${name}_peers_block": order => "30-peers-00-${name}", target => $config_file,