Skip to content

Commit 2679e8f

Browse files
authored
Merge pull request #584 from puppetlabs/CAT-1426-removal-of-red-hat-scientific-oracle-linux-6-for-haproxy-module
(CAT-1426)-Removal of redhat/scientific/oraclelinux 6 for haproxy module
2 parents 0462b3b + 10c144e commit 2679e8f

File tree

3 files changed

+36
-65
lines changed

3 files changed

+36
-65
lines changed

manifests/instance_service.pp

Lines changed: 34 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -79,57 +79,45 @@
7979
if ($title == 'haproxy') and ($haproxy_package == 'haproxy') {
8080
} else {
8181
$initfile = "/etc/init.d/haproxy-${title}"
82-
if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '6' {
83-
# init.d:
84-
file { $initfile:
85-
ensure => file,
86-
mode => '0744',
87-
owner => 'root',
88-
group => 'root',
89-
source => $haproxy_init_source,
90-
}
91-
File[$haproxy_link] -> File[$initfile]
82+
# systemd:
83+
if $haproxy_package == 'haproxy' {
84+
$wrapper = '/usr/sbin/haproxy-systemd-wrapper'
9285
} else {
93-
# systemd:
94-
if $haproxy_package == 'haproxy' {
95-
$wrapper = '/usr/sbin/haproxy-systemd-wrapper'
96-
} else {
97-
$wrapper = "/opt/${haproxy_package}/sbin/haproxy-systemd-wrapper"
98-
}
86+
$wrapper = "/opt/${haproxy_package}/sbin/haproxy-systemd-wrapper"
87+
}
9988

100-
if $facts['os']['family'] == 'RedHat' {
101-
$unitfile = "/usr/lib/systemd/system/haproxy-${title}.service"
102-
} else {
103-
$unitfile = "/lib/systemd/system/haproxy-${title}.service"
104-
}
89+
if $facts['os']['family'] == 'RedHat' {
90+
$unitfile = "/usr/lib/systemd/system/haproxy-${title}.service"
91+
} else {
92+
$unitfile = "/lib/systemd/system/haproxy-${title}.service"
93+
}
10594

106-
$parameters = {
107-
'title' => $title,
108-
'wrapper' => $wrapper,
109-
}
110-
file { $unitfile:
111-
ensure => file,
112-
mode => '0644',
113-
owner => 'root',
114-
group => 'root',
115-
content => epp($haproxy_unit_template, $parameters),
116-
notify => Exec['systemctl daemon-reload'],
117-
}
118-
if (!defined(Exec['systemctl daemon-reload'])) {
119-
exec { 'systemctl daemon-reload':
120-
command => 'systemctl daemon-reload',
121-
path => '/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin',
122-
refreshonly => true,
123-
before => Service["haproxy-${title}"],
124-
}
125-
}
126-
File[$haproxy_link] -> File[$unitfile]
127-
# Clean up in case the old init.d-style file is still around.
128-
file { $initfile:
129-
ensure => absent,
130-
before => Service["haproxy-${title}"],
95+
$parameters = {
96+
'title' => $title,
97+
'wrapper' => $wrapper,
98+
}
99+
file { $unitfile:
100+
ensure => file,
101+
mode => '0644',
102+
owner => 'root',
103+
group => 'root',
104+
content => epp($haproxy_unit_template, $parameters),
105+
notify => Exec['systemctl daemon-reload'],
106+
}
107+
if (!defined(Exec['systemctl daemon-reload'])) {
108+
exec { 'systemctl daemon-reload':
109+
command => 'systemctl daemon-reload',
110+
path => '/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin',
111+
refreshonly => true,
112+
before => Service["haproxy-${title}"],
131113
}
132114
}
115+
File[$haproxy_link] -> File[$unitfile]
116+
# Clean up in case the old init.d-style file is still around.
117+
file { $initfile:
118+
ensure => absent,
119+
before => Service["haproxy-${title}"],
120+
}
133121
}
134122

135123
Package[$haproxy_package] -> File[$bindir] -> File[$haproxy_link]

spec/acceptance/userlist_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require 'spec_helper_acceptance'
44

5-
describe 'userlist define', unless: (os[:family] == 'redhat' && os[:release][0] == '5') do
5+
describe 'userlist define' do
66
pp_one = <<-PUPPETCODE
77
class { 'haproxy': }
88
haproxy::userlist { 'users_groups':

spec/spec_helper_acceptance_local.rb

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,8 @@ def retry_on_error_matching(max_retry_count = MAX_RETRY_COUNT, retry_wait_interv
4444

4545
if os[:family] == 'redhat' && os[:release].to_i != 8
4646
epel_owner = 'puppet'
47-
epel_owner = 'stahnma' if os[:release].to_i == 6
4847
LitmusHelper.instance.run_shell("puppet module install #{epel_owner}/epel")
49-
if os[:release][0].match?(%r{5|6})
50-
pp = <<-PP
51-
class { 'epel':
52-
53-
epel_baseurl => "http://osmirror.delivery.puppetlabs.net/epel${::operatingsystemmajrelease}-\\$basearch/RPMS.all",
54-
epel_mirrorlist => "http://osmirror.delivery.puppetlabs.net/epel${::operatingsystemmajrelease}-\\$basearch/RPMS.all",
55-
56-
}
57-
PP
58-
LitmusHelper.instance.apply_manifest(pp)
59-
else
60-
LitmusHelper.instance.run_shell("puppet apply -e 'include epel'")
61-
end
62-
end
63-
if os[:family] == 'redhat' && os[:release].to_i == 6
64-
LitmusHelper.instance.run_shell('yum clean all')
65-
LitmusHelper.instance.run_shell('yum --disablerepo="epel" update nss -y')
48+
LitmusHelper.instance.run_shell("puppet apply -e 'include epel'")
6649
end
6750
pp = <<-PP
6851
package { 'curl': ensure => present, }

0 commit comments

Comments
 (0)