【发布时间】:2026-01-13 23:45:01
【问题描述】:
我在我的一个流浪项目中使用 puppet 作为我的供应商。我正在尝试为自定义 bash_profile 添加一个模块。
puppet 的module_path 设置为:
puppet.module_path = "puppet/modules"
我的 bash_profile 模块的类如下所示:
class bash_profile
{
file
{
"/home/vagrant/bash_profile":
ensure => present,
source => "puppet:///modules/bash_profile/files/bash_profile"
}
}
这是我的 puppet 结构的文件结构:
puppet
| manifests
| | phpbase.pp // my main manifest file that has includes for modules
| modules
| | bash_profile
| | | files
| | | | bash_profile // the actual bash_profile file I want to ensure is present on my VM
| | | manifests
| | | | init.pp // the init file included for the bash_profile class
当我为 vagrant 运行配置时,我收到错误
错误:/Stage[main]/Bash_profile/File[/home/vagrant/bash_profile]:无法评估:无法从环境生产源中检索信息 puppet:///modules/bash_profile/files/bash_profile在 /tmp/vagrant-puppet-1/modules-0/bash_profile/manifests/init.pp:8
我不确定为什么它无法检索信息。路径似乎是正确的。谁能看到我错过了什么?
【问题讨论】:
-
@timbooo,只是好奇,你为什么要编辑标题?我以这种方式为我的问题添加前缀,以便我以后更容易回顾它们。
-
标题中不需要加标签,见this link。您也可以使用标签以与主题相关的方式处理您的问题。
-
明白了,感谢您的链接和澄清。
标签: vagrant puppet provisioning vagrantfile