Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
# configuration files. Default: true, Set to false if you don't want to
# automatically restart the service.
#
# [*service_manage*]
# When you make HA with corosync/pacemaker for exemple, the mysql service
# status should be managed by corosync/pacemaker. Set this parameter to true
# allow you to tell puppet to not change mysql service status
#
# [*version*]
# The package version, used in the ensure parameter of package type.
# Default: present. Can be 'latest' or a specific version number.
Expand Down Expand Up @@ -225,6 +230,7 @@
$source_dir_purge = params_lookup( 'source_dir_purge' ),
$template = params_lookup( 'template' ),
$service_autorestart = params_lookup( 'service_autorestart' , 'global' ),
$service_manage = params_lookup( 'service_manage' ),
$options = params_lookup( 'options' ),
$version = params_lookup( 'version' ),
$absent = params_lookup( 'absent' ),
Expand Down Expand Up @@ -263,6 +269,7 @@

$bool_source_dir_purge=any2bool($source_dir_purge)
$bool_service_autorestart=any2bool($service_autorestart)
$bool_service_manage=any2bool($service_manage)
$bool_absent=any2bool($absent)
$bool_disable=any2bool($disable)
$bool_disableboot=any2bool($disableboot)
Expand Down Expand Up @@ -298,9 +305,12 @@
},
}

$manage_service_ensure = $mysql::bool_disable ? {
true => 'stopped',
false => 'running',
$manage_service_ensure = $mysql::bool_service_manage ? {
true => $mysql::bool_disable ? {
true => 'stopped',
false => 'running',
},
false => undef,
}

$manage_service_autorestart = $mysql::bool_service_autorestart ? {
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
$version = 'present'
$options = ''
$service_autorestart = true
$service_manage = true
$absent = false
$disable = false
$disableboot = false
Expand Down
6 changes: 6 additions & 0 deletions spec/classes/mysql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,11 @@
it { should contain_monitor__process('mysql_process').with_enable('true') }
end

describe 'Test do not manage service status' do
let(:params) { { :service_manage => false } }

it { should contain_service('mysql').with_ensure(nil) }
end

end