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

Need --exclude switch on install target to avoid duplicate installations #290

Open
hesco opened this issue Mar 27, 2015 · 3 comments
Open

Comments

@hesco
Copy link

hesco commented Mar 27, 2015

The use case I face at the moment involves developing and testing new in-house modules not intended for release of their proprietary business rules to the forge. Automating rspec-puppet and serverspec tests on this code requires creating an environment with both forge hosted modules from the public domain and in-house hosted modules. Some of those in-house modules have dependencies on still others hosted on the forge. Setting up that test framework looks like this:

#!/bin/bash

if [[ $1 == '' ]]
then 
  TARGET='install --path=modules'
  /bin/echo "USAGE: Defaulting to install target for modules path"
else
  TARGET=$1
fi

LIBRARIAN=/usr/bin/librarian-puppet

echo 'Build dependencies from puppet forge.'
cd etc/puppet
$LIBRARIAN $TARGET
cd - 

echo 'Build dependencies from the internal code base.'
cd etc/puppet/environments/production
$LIBRARIAN $TARGET
cd - 

exit 0

Consequently I would like to run:

librarian-puppet install --exclude=../../modules --path=modules

and have it do the right thing to avoid the duplicate installation of forge modules, so I do not wind up with stdlib being installed at both /etc/puppet/modules (where I want to see it) and /etc/puppet/environments/production/modules, where its presence poses a threat of hard to resolve bugs.

Would appreciate such a contribution from anyone so inclined, or in case the team might see this as germane to this client's priorities and thus a suitable use of the time they pay me for, then folks feedback on this.

@hesco
Copy link
Author

hesco commented Mar 27, 2015

Perhaps another way to resolve my issue and satisfy my use case would be the addition of a --no-follow switch, so I could specify on the install target invocation that for these in-house modules I do not want the dependency chain followed; that it should only install those items explicitly listed in the Puppetfile.

@carlossg
Copy link
Collaborator

why not run librarian puppet to get all the modules and then move the ones you want to a different folder?

@hesco
Copy link
Author

hesco commented Mar 30, 2015

that is my current work-around, but is less than elegant. I think of my first suggestion: with the --exclude switch as the most elegant and natural and generally useful implementation.

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

2 participants