Skip to content

Commit

Permalink
Make sure the service is en/disabled per user request (voxpupuli#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwevers authored and petems committed Jul 13, 2017
1 parent bc24181 commit 81ee59c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions manifests/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
if $title != 'default' {
service { $title:
ensure => $service_ensure,
enable => $service_enable,
hasrestart => $service_hasrestart,
hasstatus => $service_hasstatus,
subscribe => [
Expand All @@ -261,6 +262,7 @@
if $title != 'default' {
service { $title:
ensure => $service_ensure,
enable => $service_enable,
hasrestart => $service_hasrestart,
hasstatus => $service_hasstatus,
subscribe => [
Expand Down
4 changes: 4 additions & 0 deletions spec/defines/instance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
it { should contain_file('/etc/redis/redis.conf.puppet.redis2').with('content' => /^unixsocket \/var\/run\/redis\/redis-server-redis2.sock/) }
it { should contain_file('/var/lib/redis/redis-server-redis2') }
it { should contain_service('redis2').with_ensure('running') }
it { should contain_service('redis2').with_enable('true') }
it { should contain_file('/etc/init.d/redis2').with_content(/DAEMON_ARGS=\/etc\/redis\/redis.conf.redis2/) }
it { should contain_file('/etc/init.d/redis2').with_content(/PIDFILE=\/var\/run\/redis\/redis-server-redis2.pid/) }
end
Expand All @@ -36,6 +37,7 @@
it { should contain_file('/etc/redis/redis.conf.puppet.redis2').with('content' => /^unixsocket \/var\/run\/redis\/redis-server-redis2.sock/) }
it { should contain_file('/var/lib/redis/redis-server-redis2') }
it { should contain_service('redis2').with_ensure('running') }
it { should contain_service('redis2').with_enable('true') }
it { should contain_file('/etc/systemd/system/redis2.service').with_content(/ExecStart=\/usr\/bin\/redis-server \/etc\/redis\/redis.conf.redis2/) }
end
end
Expand All @@ -50,6 +52,7 @@
it { should contain_file('/etc/redis.conf.puppet.redis2').with('content' => /^unixsocket \/var\/run\/redis\/redis-server-redis2.sock/) }
it { should contain_file('/var/lib/redis/redis-server-redis2') }
it { should contain_service('redis2').with_ensure('running') }
it { should contain_service('redis2').with_enable('true') }
it { should contain_file('/etc/init.d/redis2').with_content(/REDIS_CONFIG="\/etc\/redis.conf.redis2"/) }
it { should contain_file('/etc/init.d/redis2').with_content(/pidfile="\/var\/run\/redis\/redis-server-redis2.pid"/) }
end
Expand All @@ -65,6 +68,7 @@
it { should contain_file('/etc/redis.conf.puppet.redis2').with('content' => /^unixsocket \/var\/run\/redis\/redis-server-redis2.sock/) }
it { should contain_file('/var/lib/redis/redis-server-redis2') }
it { should contain_service('redis2').with_ensure('running') }
it { should contain_service('redis2').with_enable('true') }
it { should contain_file('/etc/systemd/system/redis2.service').with_content(/ExecStart=\/usr\/bin\/redis-server \/etc\/redis.conf.redis2/) }
end
end
Expand Down

0 comments on commit 81ee59c

Please sign in to comment.