Showing with 52 additions and 70 deletions.
  1. +9 −0 CHANGELOG.md
  2. +3 −1 manifests/backend.pp
  3. +2 −2 manifests/config.pp
  4. +34 −46 manifests/instance_service.pp
  5. +2 −2 metadata.json
  6. +1 −1 spec/acceptance/userlist_spec.rb
  7. +1 −18 spec/spec_helper_acceptance_local.rb
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [v7.2.1](https://github.com/puppetlabs/puppetlabs-haproxy/tree/v7.2.1) - 2023-09-26

[Full Changelog](https://github.com/puppetlabs/puppetlabs-haproxy/compare/v7.2.0...v7.2.1)

### Fixed

- Replace merge() with native puppet code [#579](https://github.com/puppetlabs/puppetlabs-haproxy/pull/579) ([hawkeye-7](https://github.com/hawkeye-7))
- haproxy::backend: Always set $_sort_options_alphabetic [#576](https://github.com/puppetlabs/puppetlabs-haproxy/pull/576) ([bastelfreak](https://github.com/bastelfreak))

## [v7.2.0](https://github.com/puppetlabs/puppetlabs-haproxy/tree/v7.2.0) - 2023-08-11

[Full Changelog](https://github.com/puppetlabs/puppetlabs-haproxy/compare/v7.1.0...v7.2.0)
Expand Down
4 changes: 3 additions & 1 deletion manifests/backend.pp
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@
if $picked_sort_options_alphabetic == false {
$_sort_options_alphabetic = $picked_sort_options_alphabetic
} else {
if $options.is_a(Hash) and 'option' in $options {
if $options =~ Hash and 'option' in $options {
if ('httpchk' in $options['option']) {
warning('Overriding the value of $sort_options_alphabetic to "false" due to "httpchk" option defined')
$_sort_options_alphabetic = false
} else {
$_sort_options_alphabetic = $picked_sort_options_alphabetic
}
} else {
$_sort_options_alphabetic = $picked_sort_options_alphabetic
Expand Down
4 changes: 2 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
}

if $merge_options {
$_global_options = merge($haproxy::params::global_options, $global_options)
$_defaults_options = merge($haproxy::params::defaults_options, $defaults_options)
$_global_options = $haproxy::params::global_options + $global_options
$_defaults_options = $haproxy::params::defaults_options + $defaults_options
} else {
$_global_options = $global_options
$_defaults_options = $defaults_options
Expand Down
80 changes: 34 additions & 46 deletions manifests/instance_service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -79,57 +79,45 @@
if ($title == 'haproxy') and ($haproxy_package == 'haproxy') {
} else {
$initfile = "/etc/init.d/haproxy-${title}"
if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '6' {
# init.d:
file { $initfile:
ensure => file,
mode => '0744',
owner => 'root',
group => 'root',
source => $haproxy_init_source,
}
File[$haproxy_link] -> File[$initfile]
# systemd:
if $haproxy_package == 'haproxy' {
$wrapper = '/usr/sbin/haproxy-systemd-wrapper'
} else {
# systemd:
if $haproxy_package == 'haproxy' {
$wrapper = '/usr/sbin/haproxy-systemd-wrapper'
} else {
$wrapper = "/opt/${haproxy_package}/sbin/haproxy-systemd-wrapper"
}
$wrapper = "/opt/${haproxy_package}/sbin/haproxy-systemd-wrapper"
}

if $facts['os']['family'] == 'RedHat' {
$unitfile = "/usr/lib/systemd/system/haproxy-${title}.service"
} else {
$unitfile = "/lib/systemd/system/haproxy-${title}.service"
}
if $facts['os']['family'] == 'RedHat' {
$unitfile = "/usr/lib/systemd/system/haproxy-${title}.service"
} else {
$unitfile = "/lib/systemd/system/haproxy-${title}.service"
}

$parameters = {
'title' => $title,
'wrapper' => $wrapper,
}
file { $unitfile:
ensure => file,
mode => '0644',
owner => 'root',
group => 'root',
content => epp($haproxy_unit_template, $parameters),
notify => Exec['systemctl daemon-reload'],
}
if (!defined(Exec['systemctl daemon-reload'])) {
exec { 'systemctl daemon-reload':
command => 'systemctl daemon-reload',
path => '/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin',
refreshonly => true,
before => Service["haproxy-${title}"],
}
}
File[$haproxy_link] -> File[$unitfile]
# Clean up in case the old init.d-style file is still around.
file { $initfile:
ensure => absent,
before => Service["haproxy-${title}"],
$parameters = {
'title' => $title,
'wrapper' => $wrapper,
}
file { $unitfile:
ensure => file,
mode => '0644',
owner => 'root',
group => 'root',
content => epp($haproxy_unit_template, $parameters),
notify => Exec['systemctl daemon-reload'],
}
if (!defined(Exec['systemctl daemon-reload'])) {
exec { 'systemctl daemon-reload':
command => 'systemctl daemon-reload',
path => '/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin',
refreshonly => true,
before => Service["haproxy-${title}"],
}
}
File[$haproxy_link] -> File[$unitfile]
# Clean up in case the old init.d-style file is still around.
file { $initfile:
ensure => absent,
before => Service["haproxy-${title}"],
}
}

Package[$haproxy_package] -> File[$bindir] -> File[$haproxy_link]
Expand Down
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "puppetlabs-haproxy",
"version": "7.2.0",
"version": "7.2.1",
"author": "puppetlabs",
"summary": "Configures HAProxy servers and manages the configuration of backend member servers.",
"license": "Apache-2.0",
"source": "https://github.com/puppetlabs/puppetlabs-haproxy",
"project_page": "https://github.com/puppetlabs/puppetlabs-haproxy",
"issues_url": "https://tickets.puppetlabs.com/CreateIssueDetails!init.jspa?pid=10707&issuetype=1&team=Modules&customfield_14200=14302&labels=triage&customfield_10005=2147&summary=Issue+found+with+module%3A+puppetlabs-haproxy",
"issues_url": "https://github.com/puppetlabs/puppetlabs-haproxy/issues",
"dependencies": [
{
"name": "puppetlabs/stdlib",
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/userlist_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'spec_helper_acceptance'

describe 'userlist define', unless: (os[:family] == 'redhat' && os[:release][0] == '5') do
describe 'userlist define' do
pp_one = <<-PUPPETCODE
class { 'haproxy': }
haproxy::userlist { 'users_groups':
Expand Down
19 changes: 1 addition & 18 deletions spec/spec_helper_acceptance_local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,8 @@ def retry_on_error_matching(max_retry_count = MAX_RETRY_COUNT, retry_wait_interv

if os[:family] == 'redhat' && os[:release].to_i != 8
epel_owner = 'puppet'
epel_owner = 'stahnma' if os[:release].to_i == 6
LitmusHelper.instance.run_shell("puppet module install #{epel_owner}/epel")
if os[:release][0].match?(%r{5|6})
pp = <<-PP
class { 'epel':
epel_baseurl => "http://osmirror.delivery.puppetlabs.net/epel${::operatingsystemmajrelease}-\\$basearch/RPMS.all",
epel_mirrorlist => "http://osmirror.delivery.puppetlabs.net/epel${::operatingsystemmajrelease}-\\$basearch/RPMS.all",
}
PP
LitmusHelper.instance.apply_manifest(pp)
else
LitmusHelper.instance.run_shell("puppet apply -e 'include epel'")
end
end
if os[:family] == 'redhat' && os[:release].to_i == 6
LitmusHelper.instance.run_shell('yum clean all')
LitmusHelper.instance.run_shell('yum --disablerepo="epel" update nss -y')
LitmusHelper.instance.run_shell("puppet apply -e 'include epel'")
end
pp = <<-PP
package { 'curl': ensure => present, }
Expand Down