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

Allow optional prefixing. #53

Merged
merged 2 commits into from
Aug 14, 2013
Merged

Allow optional prefixing. #53

merged 2 commits into from
Aug 14, 2013

Conversation

adam-vessey
Copy link
Contributor

Allows "prefix" to be specified on each source (as a boolean true/false, defaulting to false), whether or not the name will be used to prefix the directory name used.

@adrienthebo
Copy link
Contributor

@adam-vessey this is absolutely excellent, thanks for taking the time to add this! It's late here and I'm not in the most clear-headed of states, but to confirm - this will add an optional prefix key for sources that will be prefixed to each environment?

@adam-vessey
Copy link
Contributor Author

That's it. It's not actually the value of the prefix key that we use (it's currently expected to be a boolean), but... the errr... I'm not familiar with the nomenclature in yaml... The name of the source node? So each source is "under" a name, right? So if git@github.com:example/repo had a branch master and test:

# The location to use for storing cached Git repos
:cachedir: '/var/cache/r10k'

# A list of git repositories to create
:sources:
 :our_example:
   remote: 'git@github.com:example/repo
   basedir: '/etc/puppet/environments'
   prefix: true

:purgedirs:
  - '/etc/puppet/environments'

would result in environments named our_example_master and our_example_test.

Then, when we look for "stale" branches, we know to only search for things with our prefix, so multiple repos don't wipe each other out.

@adam-vessey
Copy link
Contributor Author

It is admittedly kinda weird... If there are multiple sources and any one in not prefixed, everything except those environments from the unprefixed source will be deleted (and if there are two unprefixed, everything will be deleted), as in #52... We should maybe consider making it automatically prefix if there are multiple sources?

@Finchster
Copy link

I think the automatic prefix with multiple sources makes more sense as I cant see a use case for having one with and one without?

Thanks for looking at this, as I was saying in #48, this is a killer feature for us to use in production as it will allow us to split up our puppet modules per in-house application and let different teams maintain them individually.

Could be overridden if required by specifying `prefix: false` in
a given source definition.
@adam-vessey
Copy link
Contributor Author

Now automatically prefixes if there is more than one source, and prefixing can still be forced on with the prefix parameter if there is only one source.

adrienthebo added a commit that referenced this pull request Aug 14, 2013
@adrienthebo adrienthebo merged commit 1441b0c into puppetlabs:master Aug 14, 2013
@adrienthebo
Copy link
Contributor

Merged into master in 1441b0c; this should be released in 1.1.0. Right now I'm preparing for Puppetconf so I don't have the time to work on the new release until after the 24th, but after then I should have a lot more time to work on r10k. @adam-vessey thanks very much for the submission and @Finchster thanks for offering feedback!

@diginc
Copy link

diginc commented Sep 11, 2013

RE: Multiple sources, one with prefix => true and others with prefix => false AND with shared basedirs.

This seems to bug purging if they share the same basedir directory, seems the non-prefixed source remains and the prefixed one gets deleted:

Details moved to #64

Edit: Details moved to bug.

@adrienthebo
Copy link
Contributor

@diginc could you file a new bug report for this behavior?

sarameisburger pushed a commit to sarameisburger/r10k that referenced this pull request Apr 12, 2019
…puppet_forge_dependency

(CODEMGMT-307) Add puppet_forge dependency to pe-r10k
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

Successfully merging this pull request may close these issues.

None yet

4 participants