0

Feeling like a complete newbie to puppet (I admit I am very rusty :-)

So my manifest/site.pp file contains.

 file {"/tmp/findme.txt":
    source => "puppet:///modules/concat/concatfragments.rb"
  }


  file { "/etc/pupppetlabs/code/":
    path => "/etc/puppetlabs/code/",
    source  => "puppet:///modules/puppetEnv/code/",
    recurse => true
  }

The first file copy works just fine. I find the file in /tmp/findme.txt, but the 2nd file copy (actually a directory copy) doesn't work. It gets and error of

==> puppetmaster: Error: /Stage[main]/Main/Node[puppetmaster]/File[/etc/pupppetlabs/code/]: Could not evaluate: Could not retrieve information from environment bootmaster source(s) puppet:///modules/puppetEnv/code

Other pieces of information.

from my Vagrantfile

 pm.vm.provision "puppet" do |puppet|
   # puppet.options = "--verbose --debug"
    puppet.environment_path = "code/environments"
    puppet.environment = "bootmaster"
  end

Looking at the resulting /tmp/vagrant-puppet directory on the vm (where vagrant puts the puppet files) things look fine.

[vagrant@puppetmaster vagrant-puppet]$ tree -d
.
├── environments
│   ├── bootmaster
│   │   ├── manifests
│   │   └── modules
│   │       ├── baseconfig
│   │       │   └── manifests
│   │       ├── concat
│   │       │   ├── files
│   │       │   ├── lib
. . . 
│   │       ├── puppetEnv
│   │       │   ├── files
│   │       │   │   └── code
│   │       │   │       └── environments
│   │       │   │           └── test
│   │       │   │               ├── manifests
│   │       │   │               └── modules
  • Sorry, But I don't see code directory in your tree -d output – c4f4t0r Nov 22 '15 at 13:31
0

Your problem looks to be the trailing slash in your paths.

You also don't need to specify the path as it's inherited from the resource's name, and it's always best to explicitly ensure that it's a directory for code readability.

Example:

file { '/etc/pupppetlabs/code':
  ensure  => directory,
  source  => 'puppet:///modules/puppetEnv/code',
  recurse => true,
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.