Install the service, and make sure we set ENABLED=1 in /etc/default/haproxy

This commit is contained in:
R. Tyler Croy 2012-04-14 21:19:19 -07:00
parent 649483cb7d
commit 34221826fb
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1 @@
ENABLED=1

View File

@ -6,4 +6,20 @@ class haproxy {
'haproxy' :
ensure => present;
}
service {
'haproxy' :
enable => true,
hasrestart => true,
hasstatus => true,
ensure => running;
}
file {
'/etc/default/haproxy' :
ensure => present,
owner => 'root',
group => 'root',
source => 'puppet:///modules/haproxy/haproxy.default.etc';
}
}

View File

@ -16,5 +16,23 @@ describe 'haproxy' do
'ensure' => 'present'
)
end
it 'should install the haproxy service' do
subject.should contain_service('haproxy').with(
'ensure' => 'running',
'enable' => 'true',
'hasrestart' => 'true',
'hasstatus' => 'true'
)
end
it 'should install a new /etc/default/haproxy' do
subject.should contain_file('/etc/default/haproxy').with(
'ensure' => 'present',
'owner' => 'root',
'group' => 'root',
'source' => 'puppet:///modules/haproxy/haproxy.default.etc'
)
end
end
end