summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Chicoli <rafaelchicoli@hotmail.com>2016-01-27 22:51:01 +0100
committerRafael Chicoli <rafaelchicoli@hotmail.com>2016-01-27 22:51:01 +0100
commitc45d8e2f43919785134f02ca34c98ca943c82166 (patch)
treee81ff8445b167c62c36e217c857d518a0be6fc98
parentecc63a0a28c362ddf4797d3be27a1660c1fa0d94 (diff)
fix service start and stop
-rw-r--r--manifests/init.pp4
-rw-r--r--manifests/params.pp7
-rw-r--r--manifests/service.pp4
-rw-r--r--spec/classes/gitlab_ci_multi_runner_spec.rb6
4 files changed, 20 insertions, 1 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 0b71778..1670d98 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -33,6 +33,10 @@ class gitlab_ci_multi_runner (
$service_name = $gitlab_ci_multi_runner::params::service_name,
$service_ensure = $gitlab_ci_multi_runner::params::service_ensure,
$service_enable = $gitlab_ci_multi_runner::params::service_enable,
+ $service_start = $gitlab_ci_multi_runner::params::service_start,
+ $service_stop = $gitlab_ci_multi_runner::params::service_stop,
+ $service_status = $gitlab_ci_multi_runner::params::service_status,
+ $service_restart = $gitlab_ci_multi_runner::params::service_restart,
$manage_package_repo = $gitlab_ci_multi_runner::params::manage_package_repo,
$user = $gitlab_ci_multi_runner::params::user,
$group = $gitlab_ci_multi_runner::params::group,
diff --git a/manifests/params.pp b/manifests/params.pp
index 2f94a7c..d883d12 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -13,18 +13,23 @@ class gitlab_ci_multi_runner::params {
$runners = undef
$service_ensure = true
- $service_enable = true
+ $service_start = '/usr/bin/gitlab-ci-multi-runner start'
+ $service_stop = '/usr/bin/gitlab-ci-multi-runner stop'
+ $service_status = '/usr/bin/gitlab-ci-multi-runner status'
+ $service_restart = '/usr/bin/gitlab-ci-multi-runner restart'
case $::osfamily {
'Debian': {
$package_name = 'gitlab-ci-multi-runner'
$service_name = 'gitlab-runner'
$manage_package_repo = true
+ $service_enable = false
}
'RedHat': {
$package_name = 'gitlab_ci_multi_runner'
$service_name = 'gitlab_ci_multi_runner'
$manage_package_repo = false
+ $service_enable = true
}
default: {
fail("${::operatingsystem} not supported")
diff --git a/manifests/service.pp b/manifests/service.pp
index 7785699..c0d4e95 100644
--- a/manifests/service.pp
+++ b/manifests/service.pp
@@ -8,6 +8,10 @@ class gitlab_ci_multi_runner::service {
service { $gitlab_ci_multi_runner::service_name:
ensure => $gitlab_ci_multi_runner::service_ensure,
enable => $gitlab_ci_multi_runner::service_enable,
+ start => $gitlab_ci_multi_runner::service_start,
+ stop => $gitlab_ci_multi_runner::service_stop,
+ status => $gitlab_ci_multi_runner::service_status,
+ restart => $gitlab_ci_multi_runner::service_restart,
hasstatus => true,
hasrestart => true,
}
diff --git a/spec/classes/gitlab_ci_multi_runner_spec.rb b/spec/classes/gitlab_ci_multi_runner_spec.rb
index f23ab90..2092e9f 100644
--- a/spec/classes/gitlab_ci_multi_runner_spec.rb
+++ b/spec/classes/gitlab_ci_multi_runner_spec.rb
@@ -32,6 +32,12 @@ describe 'gitlab_ci_multi_runner', :type => :class do
it { should contain_package('gitlab-ci-multi-runner').with_name('gitlab-ci-multi-runner').with_ensure('present') }
it { should contain_package('apt-transport-https').with_ensure('present') }
+
+ context 'with service_enable set to false' do
+ let(:params) { {'service_enable' => false} }
+ it { should_not contain_service('gitlab-ci-multi-runner') }
+ end
+
end
end
end