HomePhorge

(#15202) Make puppet module install create parent directories
3c07e11d0df7Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#15202) Make puppet module install create parent directories

Without this patch, the puppet module install command will fail when run
as a normal user account without a ~/.puppet directory.

The error is:

$ puppet module install puppetlabs-cloud_provisioner
Preparing to install into /Users/jeff/.puppet/modules ...
Error: Could not install module 'puppetlabs-cloud_provisioner' (latest)
  Directory /Users/jeff/.puppet/modules does not exist

This is a problem because it adds friction to the process of getting started
with Puppet.

This patch fixes the problem by creating the directory if the path does not
already exist. If the path does exist, then the error is still thrown, but has
been modified slightly to provide helpful next actions. The error when the
path exists as a non-directory looks like:

Error: Could not install module 'puppetlabs-cloud_provisioner' (latest)
  The reason is path '/Users/jeff/.puppet/modules' is not a directory.
  A potential solution is `mkdir -p '/Users/jeff/.puppet/modules'`.

This patch also handles the situation where the target path does not exist but
the effective uid of the puppet process does not have access to create the
directory. The error message in this case looks like:

Error: Could not install module 'puppetlabs-cloud_provisioner' (latest)
  Permission is denied when trying to create directory '/Users/jeff/.puppet/modules'.
  A potential solution is to check the ownership and permissions of parent directories.

Details

Provenance
Jeff McCune <jeff@puppetlabs.com>Authored on
Andrew Parker <andy@puppetlabs.com>Committed on Jun 29 2012, 11:43 PM
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU2d5a5dda374e: Merge branch 'fix/3.0rc/diff_warning_specs' into 3.0rc
Branches
Unknown
Tags
Unknown

Event Timeline

Andrew Parker <andy@puppetlabs.com> committed rPU3c07e11d0df7: (#15202) Make puppet module install create parent directories (authored by Jeff McCune <jeff@puppetlabs.com>).Jun 29 2012, 11:43 PM