繁体   English   中英

如果人偶的主要清单是site.pp,清单和模块目录中的文件是否会被忽略?

[英]If the puppet main manifest is site.pp, then are files in the manifests and modules directory ignored?

默认情况下,site.pp是主要清单,我注意到在此文件中键入的内容都会被puppet识别。

但是,当我尝试在manifests或modules目录中创建某些内容时,puppet似乎会忽略它。

由于主要清单是site.pp,这是否意味着它会忽略那些目录中的内容? 我是否必须在site.pp中编写一些内容才能使其识别其他模块或清单?

据我了解,只要您的puppet.conf文件配置了“ basemodulepath”值,那么放置在该basemodulepath定义的目录中的任何内容都应自动加载。

从那里开始,您需要做的就是使用包含的内容,使用创建的模块在site.pp内定义节点。

我在付费实验室中使用Puppet Enterprise,所以在YMMV中使用,但是我只是在实验室中进行了此操作,没有任何问题。 我的basemodulepath是:

basemodulepath = /etc/puppetlabs/puppet/modules:/opt/puppet/share/puppet/modules

我在以下路径下定义了一个motd模块:/ etc / puppetlabs / puppet / modules / motd /,因此我的模块是自动加载的(它是/ etc / puppetlabs / puppet / modules的子目录,它是配置的basemodulepath的一部分)。

至此,在site.pp内部需要做的就是定义要向其应用模块的节点,并包括motd模块:

node 'mynode_certname'{
    include motd
}

我希望这能够帮到你。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM