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

Fix non-ssl, abilliy to customize templates, and run with less privileges (but call r10k/mco via sudo) #170

Merged
merged 3 commits into from
May 14, 2015

Conversation

robbat2
Copy link
Contributor

@robbat2 robbat2 commented May 13, 2015

No description provided.

robbat2 added 3 commits May 12, 2015 17:24
If enable_ssl is false, the script still tries to read the
public/private_key_path, and completely fails if the files are missing
or invalid.

This fixes the script to NOT pass those parameters (or try to read the
files) unless enable_ssl is true.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
It should be possible to run the webhook as an unprivileged user (eg
nobody) and only invoke r10k/mco via sudo.

sudoers examples:
nobody ALL=(root) NOPASSWD: r10k deploy environment *, r10k deploy module *
nobody ALL=(peadmin) NOPASSWD: mco r10k deploy *, mco r10k deploy_module *

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
@@ -152,10 +156,10 @@ class Server < Sinatra::Base
end
else
if $config['use_mcollective']
command = "mco r10k deploy #{branch} >> #{$config['mco_logfile']} 2>&1 &"
command = "#{$command_prefix} mco r10k deploy #{branch} >> #{$config['mco_logfile']} 2>&1 &"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not super clear on why this is needed if you are running the script as the user, is the user case that you want to run the script as say root and then run r10k as non-root?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm running webhook as non-root and sudoing to root for r10k. I modified all of the command calls for doing that. In the case of MCO, they'd run the webhook as nobody and sudo to puppet/peadmin for mco.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the template pull is in, I've got another branch ready for the Gentoo init script.
https://github.com/robbat2/r10k/commit/4dcba8212ead2fe3c829867e1fd8ecc6ce662c1f

acidprime added a commit that referenced this pull request May 14, 2015
Fix non-ssl, abilliy to customize templates, and run with less privileges (but call r10k/mco via sudo)
@acidprime acidprime merged commit f26a487 into voxpupuli:master May 14, 2015
@robbat2
Copy link
Contributor Author

robbat2 commented May 14, 2015

The trailing commas accidentally added in the new block broke the webhook. There is a fix in my other PR.

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.

2 participants