Ask Your Question

r10k not allowing any content for "$environment/modules" directory in dynamic environments

asked 2015-02-02 18:58:15 -0600

schowdh gravatar image

updated 2015-02-02 22:41:11 -0600

Hi Folks,

I am trying my hands with dynamic environments. I mostly refrered to the documentations at , , and

Now the steps I fllowed are:

  1. Install r10k by using the command

puppet module install zack/r10k

once installed, I create a the following r10k_installation.pp file

> class { 'r10k':   version           =>
> '1.4.1',   sources           => {
>     'puppet' => {
>       'remote'  => 'ssh://git@my.git.server/path/to/my_puppet_repository.git',
>       'basedir' => "${::settings::confdir}/environments",
>       'prefix'  => false,
>     }   },   purgedirs         => ["${::settings::confdir}/environments"],
> manage_modulepath => true,  
> modulepath        =>
> "${::settings::confdir}/environments/\$environment/modules:/opt/puppet/share/puppet/modules",
> }

and run the installation. I am using PE3.7, it already has environment directory and a production environment inside it. Since running

r10k deploy environment -pv

says I have an non empty production directory I just mv the entire production directory somewhere else, so that I have blank environment directory.

The installation/deployment goes through. I find it has created folders based on my branches available at git server for puppet repo.

Now doing a git branch -a at any of the environment directory shows [no branch], not sure why as the example I followed showed it points to a proper branch.

Though this does not so far affect my work, i ignored it. the main problem I face is, I try to create a directory named "modules" under /etc/puppetlabls/puppet/environments/$environment/.

So I create this directory and add few modules of my own inside this directory and push the whole thing into git server. While I run the deploy on puppet server, I see just the "modules" directory, but everything inside is blank. None of my actual modules shows up inside it. If I changes the name of the folder to anything else like modules_a, or say module, I see no issues. the folder contains all my modules. But the moment I change the folder name back to modules I go back to the problem.

It looks like as if the deployment does not allow anything to be inside "modules" folder. Now I am not sure if this is an expected behavior.

At this moment I am not sure if this is by design or I goofed up something. Any help will be really appreciable.

I have distributed PE 3.7 installation on CentOS6.5 boxes, my Git Server is a Ubuntu 14.04.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-02-05 09:29:10 -0600

lorcutt gravatar image

updated 2015-02-05 09:29:40 -0600

It looks like you are not populating the git repo "mypuppetrepository.git" with a file called "Puppetfile". This file contains a list of references to modules that are used to populate the modules directory.

Each module is assumed to be a unique repo, and there is an entry in the Puppetfile for each one. An example entry would look like:

mod 'ntp',
  :git => 'git://',
  :branch => 'master'

Instead of :branch you can also use other git references such as a tag.

See for detailed information on the Puppetfile.

edit flag offensive delete link more


You saved me!!! Thanks a ton!!! I completely overlooked the Puppetfile concept. My bad!

schowdh gravatar imageschowdh ( 2015-02-05 15:17:25 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-02-02 18:58:15 -0600

Seen: 742 times

Last updated: Feb 05 '15