关于puppet的import

import "autofs"
import "autofs/init.pp"
import "autofs/util/stuff.pp"

第一句与第二句会在模块路径中寻找autofs/manifests/init.pp并载入。
第三句只载入autofs/util/stuff.pp文件。

puppet 0.23.1之后的版本,位于modulepath下(默认是/etc/puppet/modules)的模块会被自动载入,所以不需要手动载入此目录下的各个模块了。

当你引用autofs模块中的craziness类时,puppet会自动在autofs模块下寻找craziness.pp文件中的这个类。使用这个技巧就可以不在模块的init.pp中写入额外的import了。

This entry was posted in puppet and tagged , , . Bookmark the permalink.

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

Note: If you are replying to another commenter, click the "Reply to {NAME} ↵" button under their comment!