-
Notifications
You must be signed in to change notification settings - Fork 213
Use knife[:solo_path] as secure-ish repo location on server #145
Conversation
It requires tty_tickets be turned off in the system sudo configs. Since we now chmod the directory and don't hijack the cache location I think we should be in pretty good shape without it.
Looks like the latest apache2 cookbook defaults to a 404
Overall looks good but I didn't test it too much yet. Using hardcoded /tmp paths still leave the system vulnerable to symlink attacks. But Hmm, how about |
Of course my intention is not to expand the scope of this PR. ;) |
Hrm... I wonder if relative paths would resolve to somewhere same on all On Friday, December 28, 2012, Teemu Matilainen wrote:
-Mat about.me/matschaffer |
rsync should use paths relative to home if they are not absolute. For the Chef settings it is possible to use Or maybe I didn't understand what you meant. =) |
Since this may be set that way in existing solo.rb configs
So I realized there's a bit of a problem with the $HOME idea. Unless we do special work to see that solo_path is indeed intended to be a home directory, the dirs could be different between the work station (e.g., /User/mat) and chef-solo (e.g., /home/ubuntu) I think this is part of the reason I was wondering if solo_path should be a knife.rb config, but I'm not sure if I want to introduce a I'm thinking we should leave this as-is then try to switch from /tmp to $HOME in the next release. Thoughts? |
FWIW, I tried both of these solo.rb configurations https://gist.github.com/4432046 The first one has the different path problem. The second one almost works but we need the workstation to know the cookbook path so it can inject the patches at the right place. |
Might be too early in the morning... But as far as I understand So shouldn't it be sufficient to configure |
And I agree in the attempt to release often with fewer changes. Now we are anyway breaking backwards compatibility of solo.rb so it would be nice to avoid doing it again on the next release. |
Hrm... I'll give the relative thing a try. The workstation currently also needs the cookbook path so it knows where to On Wednesday, January 2, 2013, Teemu Matilainen wrote:
-Mat about.me/matschaffer |
Ah, I missed the cookbook_path part. That complicates things. Could this kind of trick work? https://gist.github.com/4434030/fdee4e181cde1a3eb1206e02e8210f551470085c |
Sadly, it looks like chef expects fully qualified paths. My next best guess -Mat about.me/matschaffer On Wed, Jan 2, 2013 at 8:47 AM, Teemu Matilainen
|
Oh, I thought Or is the "cookbook_path" on the work station used for other things as just uploading the patches with rsync? Or do you mean that Chef does not even want to read the solo.rb with relative paths on the work station? Uh, I have to test it myself before suggesting half baked "solutions". =) |
FILE is relative unless you do File.expand_path. Then we run into the So one more thought here. Should we maybe just get opinionated and generate That may avoid a required breaking change since we'll start just ignoring Makes me wish we had a mailing list so I could get a feel for what people On Wed, Jan 2, 2013 at 11:09 AM, Teemu Matilainen
|
But in my later gist version the |
Take a look at my solo_path_test branch. |
RE: being opinionated. I don't think we can silently default to any path at the home directory as there is always a change to override something. I guess the only (quite) secure way to be compatible with the old solo.rb would be to use the I guess we could use the chef mailing list but I'm not sure how many knife-solo users would be covered... |
Oh hey, that ENV thing isn't a bad idea. I think having it might even help |
my patch was at #77 |
get the following error with the current version (0.2.0_beta) from master Exception: NoMethodError: undefined method `remote_mkdir_p' for #<Chef::Knife::SoloCook:0x007ff9598fa5e8> |
@arosenhagen Btw, this PR will most likely still change quite a bit as it seems that the best move is to remove solo.rb from the client side and use knife.rb for configuration. And then generate the solo.rb for the node. |
got it thanks. was indeed an issue with multiple gems installed. switched back to version 0.1.0 but looking forward to have the option to re-run my recipes (at the moment i'm testing with vagrant locally, so no problem). |
@arosenhagen, maybe I don't understand what you mean, but you can re-provision the node by calling |
currently I can't re-provision the vm due to permission issues. First run is ok, but second one fails due to sudo commands in my recipes. I thought this is related to this PR since it seems as if knife solo can't clear the temporary paths correctly. |
@arosenhagen Ah, OK. That definitely is the target of this PR. |
👍 I have tried this PR to run |
Thanks! I'll try to get it merged this afternoon. Sadly it's not gonna be a On Thursday, January 31, 2013, Huiming Teo wrote:
-Mat about.me/matschaffer |
Started work on this again in issue/avoid-cache-path-1 |
Closing this in favor of #197 |
Hey guys, I tried to follow this but I'm still confused. Are the paths in In Actually, I'd prefer to specify the workstation-local paths to the cookbooks, data bags and data bag secret so knife-solo knows what to upload. I'm totally not interested in where it rsyncs this stuff to on the node, that's an implementation detail knife-solo should just handle internally. Comparing to Vagrant, it's the same concept, i.e. in you specify the local paths where to find cookbooks etc:
If you want, you can also override the path where the stuff gets uploaded (or rather mounted via fs share) to on the node, but in practice I actually never used it (an implementation detail I don't care about):
|
No description provided.