Search code examples
vagrantpuppetprovisioningvagrantfile

Could not retrieve information from environment production source


I'm using puppet as my provisioner in one of my vagrant project. I'm trying to add a module for a custom bash_profile.

The module_path for puppet is set to:

 puppet.module_path = "puppet/modules"

The class for my bash_profile module looks like this:

class bash_profile
{
    file
    {
        "/home/vagrant/bash_profile":
            ensure => present,
            source => "puppet:///modules/bash_profile/files/bash_profile"
    }
}

Here's the file structure for my puppet structure:

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

When I run the provisioning for vagrant, I get the error

err: /Stage[main]/Bash_profile/File[/home/vagrant/bash_profile]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/bash_profile/files/bash_profile at /tmp/vagrant-puppet-1/modules-0/bash_profile/manifests/init.pp:8

I'm not sure why it can't retrieve the information. The path seems to be correct. Can anyone see what I'm missing?


Solution

  • Yes, you are not supposed to include the literal files/ in the URL. Instead, it should just be

    puppet:///modules/bash_profile/bash_profile