diff --git a/manifests/cache.pp b/manifests/cache.pp index f81ecbca..77bab724 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -21,11 +21,11 @@ # # [*listen_ip*] # (optional) IP address on which memcached instance should listen -# Default to $::ipaddress_eth0 +# Default in params. # class cloud::cache ( - $listen_ip = $::ipaddress_eth0, + $listen_ip = $os_params::api_eth, ){ class { 'memcached': diff --git a/spec/classes/cloud_cache_spec.rb b/spec/classes/cloud_cache_spec.rb index 54daab28..d0866d22 100644 --- a/spec/classes/cloud_cache_spec.rb +++ b/spec/classes/cloud_cache_spec.rb @@ -22,6 +22,10 @@ describe 'cloud::cache' do shared_examples_for 'cache server' do + let :params do + { :listen_ip => '10.0.0.1' } + end + it 'configure memcached with some params' do should contain_class('memcached').with( :listen_ip => '10.0.0.1', @@ -34,8 +38,7 @@ describe 'cloud::cache' do let :facts do { :osfamily => 'Debian', :memorysize => '1000 MB', - :processorcount => '1', - :ipaddress_eth0 => '10.0.0.1' } + :processorcount => '1' } end it_configures 'cache server' @@ -45,8 +48,7 @@ describe 'cloud::cache' do let :facts do { :osfamily => 'RedHat', :memorysize => '1000 MB', - :processorcount => '1', - :ipaddress_eth0 => '10.0.0.1' } + :processorcount => '1' } end it_configures 'cache server'