Directory and file layout as follows:
app_test/
app_test/manifests
app_test/manifests/init.pp
app_test/manifests/test.pp
Contents of init.pp
:
class app_test {
include app_test::test
}
Contents of test.pp
:
class app_test::test {
exec { 'hello world':
command => "/bin/echo Hello World >> /tmp/are-you-there.txt"
}
}
Puppet v2.7.11
is installed.
$ puppet apply init.pp
notice: Finished catalog run in 0.01 seconds
Could someone please indicate why this doesn't generate the file /tmp/are-you-there-txt
?
You are only defining classes, not declaring them.
Create a file modules/[module_name]/tests/init.pp:
Contents:
include app_test
Test your class then with:
puppet apply tests/init.pp
That should do the trick!
Kind regards,
Ger Apeldoorn
You can try :
puppet apply -e 'include app_test::test'
or for a dry run
puppet apply -e 'include app_test::test' --noop
For more puppet apply, see manual page : http://docs.puppetlabs.com/man/apply.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With