11

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?

KomodoDave
  • 7,239
  • 10
  • 60
  • 92

2 Answers2

11

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

Ger Apeldoorn
  • 1,232
  • 8
  • 13
10

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

iamauser
  • 11,119
  • 5
  • 34
  • 52