Puppet 2.7:调用puppet apply init.pp什么都不做 - 为什么?

Kom*_*ave 11 manifest puppet apply

目录和文件布局如下:

app_test/
app_test/manifests
app_test/manifests/init.pp
app_test/manifests/test.pp
Run Code Online (Sandbox Code Playgroud)

内容init.pp:

class app_test {
    include app_test::test
}
Run Code Online (Sandbox Code Playgroud)

内容test.pp:

class app_test::test {
    exec { 'hello world':
        command => "/bin/echo Hello World >> /tmp/are-you-there.txt"
    }
}
Run Code Online (Sandbox Code Playgroud)

Puppet v2.7.11已安装.

$ puppet apply init.pp 
notice: Finished catalog run in 0.01 seconds
Run Code Online (Sandbox Code Playgroud)

有人可以说明为什么这不会生成文件/tmp/are-you-there-txt

Ger*_*orn 11

您只是定义类,而不是声明它们.

创建文件模块/ [module_name] /tests/init.pp:

内容:

include app_test
Run Code Online (Sandbox Code Playgroud)

然后测试你的课程:

puppet apply tests/init.pp
Run Code Online (Sandbox Code Playgroud)

这应该够了吧!

亲切的问候,

Ger Apeldoorn


iam*_*ser 10

你可以试试 :

 puppet apply -e 'include app_test::test'
Run Code Online (Sandbox Code Playgroud)

或干运行

 puppet apply -e 'include app_test::test' --noop
Run Code Online (Sandbox Code Playgroud)

有关更多木偶申请,请参见手册页:http://docs.puppetlabs.com/man/apply.html