-
Notifications
You must be signed in to change notification settings - Fork 285
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
Checkout git repository as user, fixed ensure latest, ssh options #25
Conversation
… ssh options to ensure no prompting (also fixed in pull request puppetlabs#1 by riseuplabs), added ability to keep repository up to date with latest (puppetlabs ticket 11278)
Checkout git repository as user, fixed ensure latest, ssh options
| @@ -291,6 +293,8 @@ def git_with_identity(*args) | |||
|
|
|||
| return ret | |||
| end | |||
| elsif @resource.value(:user) | |||
| su(@resource.value(:user), '-c', "git #{args.join(' ')}" ) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imagine that this will not work on say, Solaris. Possibly BSDs.
sol11% su -h Usage: su [-] [ username [ arg ... ] ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. Patch ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FreeBSD:
[hal:~]% su -h su: illegal option -- h usage: su [-] [-flms] [-c class] [login [args]]
yeah, that will break horribly....
Yes, it needs a patch for sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a pretty straightforward fix. I'll see if I can push out an
update to this around lunchtime PST today :-)
On Jun 29, 2012 10:11 AM, "Ben Hughes" <
reply@reply.github.com>
wrote:
@@ -291,6 +293,8 @@ def git_with_identity(*args)
return ret end
- elsif @resource.value(:user)
su(@resource.value(:user), '-c', "git #{args.join(' ')}" )FreeBSD:
[hal:~]% su -h su: illegal option -- h usage: su [-] [-flms] [-c class] [login [args]]yeah, that will break horribly....
Yes, it needs a patch for sure.
Reply to this email directly or view it on GitHub:
https://github.com/puppetlabs/puppetlabs-vcsrepo/pull/25/files#r1077212
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appears to work for me. What error are you getting?
On Jun 29, 2012 10:13 AM, "Eric Hayes" eric@deployfx.com wrote:
This should be a pretty straightforward fix. I'll see if I can push out an
update to this around lunchtime PST today :-)
On Jun 29, 2012 10:11 AM, "Ben Hughes" <
reply@reply.github.com>
wrote:@@ -291,6 +293,8 @@ def git_with_identity(*args)
return ret end
- elsif @resource.value(:user)
su(@resource.value(:user), '-c', "git #{args.join(' ')}" )FreeBSD:
[hal:~]% su -h su: illegal option -- h usage: su [-] [-flms] [-c class] [login [args]]yeah, that will break horribly....
Yes, it needs a patch for sure.
Reply to this email directly or view it on GitHub:
https://github.com/puppetlabs/puppetlabs-vcsrepo/pull/25/files#r1077212
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, FreeBSD does work actually:
[root@hal:/tmp]# su ben -c "git clone git://git.wincent.com/command-t.git" Cloning into 'command-t'... remote: Counting objects: 2640, done. remote: Compressing objects: 100% (964/964), done. remote: Total 2640 (delta 1445), reused 2613 (delta 1433) Receiving objects: 100% (2640/2640), 489.04 KiB | 436 KiB/s, done. Resolving deltas: 100% (1445/1445), done.
And Solaris too. I stand thoroughly corrected (and surprised...). Grand!
|
This mostly fixes the ensure => latest problem, but if you don't specify a revision, as I didn't, it still errors: This can be fixed by specifying revision => 'master', but I think it should probably fall back to 'master' as the default. |
fix unsafe default & improve doco
Run git operations as a specific user (puppetlabs ticket 4773), added ssh options to ensure no prompting (also fixed in pull request #1 by riseuplabs), added ability to keep repository up to date with latest (puppetlabs ticket 11278).