Don't start riak if not needed

This commit is contained in:
Wile E. Coyote 2017-05-05 07:21:55 +00:00
parent 32b49e6c51
commit 3f68dc32dc

View file

@ -13,6 +13,7 @@
class rhizo_base::riak {
$vpn_ip_address = $rhizo_base::vpn_ip_address
$riak_ip_address = $rhizo_base::riak_ip_address
include packagecloud
@ -69,6 +70,8 @@ class rhizo_base::riak {
'storage_backend' => 'leveldb',
}
}
if $vpn_ip_address == $riak_ip_address {
file { '/etc/init.d/riak':
ensure => file,
owner => 'root',
@ -78,6 +81,11 @@ class rhizo_base::riak {
require => Class['::riak'],
notify => Exec['insserv'],
}
} else {
file { '/etc/init.d/riak':
ensure => absent,
}
}
exec { 'insserv':
command => '/usr/lib/insserv/insserv',