Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepending '<environment_path>/modules' might be a bad idea if environment.conf is present #24

Open
markus-schuster opened this issue Feb 19, 2019 · 0 comments

Comments

@markus-schuster
Copy link

In lib/pupistry/agent.rb (build_modulepath sub) you forcefully prepend '<environment_path>/modules' to the modulepath no matter what.
In my case that's rather harmful as I have a environment.conf containing modulepath = modules/local:modules/external where modules/external contains all the r10k installed modules and modules/local contains my own modules.

In puppet 5.something this started to throw warnings on every puppet run, but well, warnings… 😄

From puppet 6.something onwards this throws an error like this:

Error: Unacceptable location. The name 'profiles::base' is unacceptable in file '/etc/puppetlabs/code/environments/master/modules/local/profiles/manifests/base.pp' (file: /etc/puppetlabs/code/environments/master/modules/local/profiles/manifests/base.pp, line: 1, column: 1) on node server.domain.tld

My solution is to remove the base modules path from modulespath.

For now I simply remove lines 173 to 175 from lib/pupistry/agent.rb and that works fine for me, but a better solution might be to not forcefully prepend <environment_path>/modules if the user specified a custom modulepath in environment.conf.
I'm not really a ruby developer but I could try to provide a pull request if you're interested in having that functionality in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant