-
Notifications
You must be signed in to change notification settings - Fork 354
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
Multiple apps with same branch names #48
Comments
This is pretty much implemented in #53. |
Ah, nm. I get it now. On Thursday, August 1, 2013, Adam wrote:
|
I'm hitting this same issue in 1.0.0 too --> https://gist.github.com/glarizza/5a81e45f2f489d87d464 and the prefixing should alleviate it... |
This should be fixed by GH-53, so I'm targeting this at |
IMHO, the prefix solution is kind of hackyugly. It means that my modulepath of:
Doesn't work. Instead I need to use:
and something similar for hiera. It works, but I don't think it should be necessary. |
@binford2k Use the Puppetfile to grab the modules on which each environment is dependent? Your modpath can include multiple paths... |
The bigger deal is that this is going to be a backwards-incompatible change in the middle of a series...the environment folders that are created aren't going to match your existing $modulepath setting in puppet.conf. While I think the prefixing is necessary and fixes some big R10k bugs, actually prefixing the FILENAME on disk should be kept for a major release. Is there a way internally to track the branch as "puppet_#{branchname}" but only create the folder name on-disk as "#{branchname}"? Within a single repo/source, you're not going to have conflicting branch names, so I don't think we'd have any clashes here. Thoughts? |
If I'm understanding correctly, what would address your concerns is to only default to using prefixes when there are multiple repos under the same basedir, and only in those basedirs where there are multiple repos being cloned? |
It was an oversight that I released the behavior as-is, because it was backwards incompatible. (To be honest I didn't realize how many users were using multiple repositories successfully.) I think that in the short run we need to revert the default case to never prefix, and in the longer run have better detection of when prefixing is needed. |
Defaulting environment prefixing to true with multiple sources are present can have unexpected outcomes if users are already using multiple sources in different directories. While it could be possible to only add prefixing to multiple sources with the same basedir, it's nontrivial and right now there's a backwards incompatible change in a released version that needs to be rolled back. This commit removes the prefix detection so that prefixing must be explicitly enabled.
@adam-vessey for the short term, do you think that 8cb2209 would be adequate to address this problem? I think that we can just roll back this behavior change in 1.1.1 and consider adding better detection in either 1.2 or 2. |
@adrienthebo Looks like that should do it. If it seems like it would be useful, I'll try to get some code together to do the actual counting (should be fairly quick), so we can default to prefixing where it seems to be required. |
In the long run I think we'll need to build a full directory structure of what files are going to go where, so we can do smarter things with prefixing and purging and whatnot. If we have that, a lot of things get much simpler. (Also, thanks for the really fast response. Holy responding to notifications batman!) |
Notes for updating to 1.1.1If you are putting multiple sources in a single directory, do this: sources:
first:
remote: 'git://something.com/repo.git'
prefix: true
basedir: '/shared/basedir'
second:
remote: 'git://somethingother.com/repo.git'
prefix: true
basedir: '/shared/basedir' This is equivalent to the automatic behavior introduced in 1.1.0. If you're using multiple sources in different directories you can omit the prefix section: sources:
first:
remote: 'git://something.com/repo.git'
basedir: '/first/basedir'
second:
remote: 'git://somethingother.com/repo.git'
basedir: '/second/basedir' If you modified your modulepath to something like this: [master]
modulepath = /etc/puppetlabs/puppet/environments/first_${environment} You can omit the |
Isn't the prefixing making usage a bit too complicated? IMO it would be nice if puppet wouldn't need to know anything about my different r10k-sources, i.e. I shouldn't be required to adjust the |
@njam The prefixing is a solution to one set of problems, but it isn't applicable to all solutions. If you're in a situation where you have a multi-tenant puppetmaster and you want each group to have an isolated set of modules, like Since the original problem described in this issue is resolved I'm going to close this issue. @njam if you think that there are better ways of handling this I would love your input; just file an issue on this project and we can go from there. :) Thanks to everybody for contributing to the reporting on this issue! |
…3-example-config-aio (PE-10983) Use r10k.yaml.example with AIO code path
It appears that if you have multiple sources/apps defined and a branch has the same name in both sources then it tries to merge the two branches together under one environment which gets messy. After a few tests it does not create two separate environments.
The preferred method for handling this would be to append the repo's name to the branch name and name the environment $repo_$branch. This way dynamic environments can be created by separate application owners without worrying about not re-using a branch name.
The text was updated successfully, but these errors were encountered: