Skip to content

Commit

Permalink
Allow changing initialize datastore binary path
Browse files Browse the repository at this point in the history
  • Loading branch information
deric committed Mar 16, 2021
2 parents b6eec06 + 6dc8b51 commit 9d4b89d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
# Initialize the datastore if required
if $zookeeper::initialize_datastore {
exec { 'initialize_datastore':
command => "/usr/bin/zookeeper-server-initialize --myid=${zookeeper::id}",
command => "${zookeeper::initialize_datastore_bin} --myid=${zookeeper::id}",
user => $zookeeper::user,
creates => "${zookeeper::datastore}/version-2",
require => [ File[$zookeeper::datastore], Class['zookeeper::install'] ],
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
String $id = $zookeeper::params::id,
Integer $init_limit = $zookeeper::params::init_limit,
Boolean $initialize_datastore = $zookeeper::params::initialize_datastore,
String $initialize_datastore_bin = $zookeeper::params::initialize_datastore_bin,
Boolean $leader = $zookeeper::params::leader,
Integer $leader_port = $zookeeper::params::leader_port,
String $log_dir = $zookeeper::params::log_dir,
Expand Down
28 changes: 16 additions & 12 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
}

$_os_overrides = {
'packages' => ['zookeeper', 'zookeeperd'],
'service_name' => 'zookeeper',
'service_provider' => $initstyle,
'shell' => '/bin/false',
'packages' => ['zookeeper', 'zookeeperd'],
'service_name' => 'zookeeper',
'service_provider' => $initstyle,
'shell' => '/bin/false',
'initialize_datastore_bin' => '/usr/bin/zookeeper-server-initialize'
}
# 'environment' file probably read just by Debian
# see #16, #81
Expand All @@ -44,10 +45,11 @@
}

$_os_overrides = {
'packages' => ['zookeeper', 'zookeeper-server'],
'service_name' => 'zookeeper-server',
'service_provider' => $initstyle,
'shell' => '/sbin/nologin',
'packages' => ['zookeeper', 'zookeeper-server'],
'service_name' => 'zookeeper-server',
'service_provider' => $initstyle,
'shell' => '/sbin/nologin',
'initialize_datastore_bin' => '/usr/bin/zookeeper-server-initialize'
}
$environment_file = 'java.env'
}
Expand All @@ -60,10 +62,11 @@
}

$_os_overrides = {
'packages' => ['zookeeper', 'zookeeper-server'],
'service_name' => 'zookeeper-server',
'service_provider' => $initstyle,
'shell' => '/bin/false',
'packages' => ['zookeeper', 'zookeeper-server'],
'service_name' => 'zookeeper-server',
'service_provider' => $initstyle,
'shell' => '/bin/false',
'initialize_datastore_bin' => '/usr/bin/zookeeper-server-initialize'
}
$environment_file = 'java.env'
}
Expand Down Expand Up @@ -135,6 +138,7 @@
$id = '1'
$init_limit = 10
$initialize_datastore = false
$initialize_datastore_bin = $_params['initialize_datastore_bin']
$leader = true
$leader_port = 3888
$log_dir = '/var/log/zookeeper'
Expand Down

0 comments on commit 9d4b89d

Please sign in to comment.