Puppet code:
# manifests/splunk/service.pp
class tpp::splunk::service
exec { 'splunk-accept-license':
command => '/opt/splunkforwarder/bin/splunk enable boot-start
--accept-license --answer-yes --no-prompt',
creates => '/etc/init.d/splunk',
before => Service['splunk'],
require => Class['splunk::install'],
}
...
}
The following rspec test works with require as shown below:
it { is_expected.to contain_exec('splunk-accept-license')
.with(
'command' => '/opt/splunkforwarder/bin/splunk enable boot-start
--accept-license --answer-yes --no-prompt',
'creates' => '/etc/init.d/splunk',
'require' => 'Class[Tpp::Splunk::Install]',
)}
However if I use the that_requires matcher it fails:
it { should contain_exec('splunk-accept-license')
.that_requires('Class[Tpp::Splunk::Install]')
}
Can someone shed some light as to why this might be the case?
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/7f1f6499-1f0a-4be3-a8b6-cb9617e8c0a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.