无法从环境生产源检索信息

Chr*_*itz 10 provisioning puppet vagrant vagrantfile

我在我的一个流浪项目中使用木偶作为我的供应者.我正在尝试为自定义bash_profile添加模块.

module_path对木偶被设置为:

 puppet.module_path = "puppet/modules"
Run Code Online (Sandbox Code Playgroud)

我的bash_profile模块的类看起来像这样:

class bash_profile
{
    file
    {
        "/home/vagrant/bash_profile":
            ensure => present,
            source => "puppet:///modules/bash_profile/files/bash_profile"
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我的木偶结构的文件结构:

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
Run Code Online (Sandbox Code Playgroud)

当我为vagrant运行配置时,我收到错误

错误:/ Stage [main]/Bash_profile/File [/ home/vagrant/bash_profile]:无法评估:无法从环境生产源中检索信息:/// modules/bash_profile/files/bash_profile at/tmp /vagrant-puppet-1/modules-0/bash_profile/manifests/init.pp:8

我不确定为什么它无法检索信息.路径似乎是正确的.任何人都能看到我错过的东西吗?

Fel*_*ank 24

是的,您不应该files/在URL中包含文字.相反,它应该是

puppet:///modules/bash_profile/bash_profile
Run Code Online (Sandbox Code Playgroud)

  • Geez,面对我对路径的期望,肯定会飞. (5认同)
  • 我刚读了相同的文档并错过了相同的观点.四个小时试图直接获得该URL!我也尝试过使用文件URI.我的同事说,在source属性中你需要关闭"file:".不确定,但它对他有用. (2认同)