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 { class rhizo_base::riak {
$vpn_ip_address = $rhizo_base::vpn_ip_address $vpn_ip_address = $rhizo_base::vpn_ip_address
$riak_ip_address = $rhizo_base::riak_ip_address
include packagecloud include packagecloud
@ -69,15 +70,22 @@ class rhizo_base::riak {
'storage_backend' => 'leveldb', 'storage_backend' => 'leveldb',
} }
} }
file { '/etc/init.d/riak':
ensure => file, if $vpn_ip_address == $riak_ip_address {
owner => 'root', file { '/etc/init.d/riak':
group => 'root', ensure => file,
mode => '0755', owner => 'root',
source => 'puppet:///modules/rhizo_base/etc/init.d/riak', group => 'root',
require => Class['::riak'], mode => '0755',
notify => Exec['insserv'], source => 'puppet:///modules/rhizo_base/etc/init.d/riak',
} require => Class['::riak'],
notify => Exec['insserv'],
}
} else {
file { '/etc/init.d/riak':
ensure => absent,
}
}
exec { 'insserv': exec { 'insserv':
command => '/usr/lib/insserv/insserv', command => '/usr/lib/insserv/insserv',