Search code examples
puppet

Puppet apply running code in test folder


Been playing around with a masterless puppet setup recently. I ran into a strange (to me) issue when doing so. I installed some puppet modules into repo and when I now run puppet apply I can see that it's executing code in the spec and test folders of all modules as well. This seems like something that shouldn't happen by default..

Error: Node 'default' is already defined (file: /etc/puppetlabs/code/environments/production/modules/consul/spec/fixtures/manifests/site.pp, line: 10); cannot redefine (file: /etc/puppetlabs/code/environments/production/modules/consul_template/examples/init.pp, line: 1) on node dev-8316f3de71.pit1.example.com

All code was working prior to a simple puppet module install. The full repo that will reproduce this is at https://github.com/michaeljs1990/puppet on github.

I have just deleted the folder for now but hoping someone has a clean answer.


Solution

  • Apparently this magically works if you install the modules inside of /etc/puppetlabs/code/modules/ although it really doesn't make sense. It's just a different location why would puppet have different rules around what files to include..