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

Fixes #11936 - Add support for kerberos auth #351

Merged
merged 8 commits into from Aug 15, 2017

Conversation

adamruzicka
Copy link
Contributor

No description provided.

@theforeman-bot
Copy link
Member

@adamruzicka, the Redmine ticket used is for a different project than the one associated with this GitHub repository. Please either:

If changing the ticket number used, remember to update the PR title and the commit message (using git commit --amend).


This message was auto-generated by Foreman's prprocessor

$scl_prefix = '' # lint:ignore:empty_string_assignment
}

foreman_proxy::plugin { 'net-ssh-krb':
Copy link
Member

Choose a reason for hiding this comment

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

I think you should use package since this isn't a plugin, it's a library. Another thing is that this will break on Debian where the package would most likely be named ruby-net-ssh-krb but isn't packaged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point about package, will do. I'll have to look into the debian naming, debian packaging pr is here

Copy link
Contributor

Choose a reason for hiding this comment

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

It will be ruby-net-ssh-krb per Debian policies.

@@ -49,6 +52,18 @@
template_path => 'foreman_proxy/plugin/remote_execution_ssh.yml.erb',
}

if $ssh_kerberos_auth {
if $::osfamily == 'RedHat' and $::operatingsystem != 'Fedora' {
Copy link
Member

Choose a reason for hiding this comment

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

The smart proxy doesn't run in SCL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an optional dependency for the smart_proxy_dynflow_core service which runs in SCL

@theforeman-bot
Copy link
Member

@adamruzicka, the Redmine ticket used is for a different project than the one associated with this GitHub repository. Please either:

If changing the ticket number used, remember to update the PR title and the commit message (using git commit --amend).


This message was auto-generated by Foreman's prprocessor

4 similar comments
@theforeman-bot
Copy link
Member

@adamruzicka, the Redmine ticket used is for a different project than the one associated with this GitHub repository. Please either:

If changing the ticket number used, remember to update the PR title and the commit message (using git commit --amend).


This message was auto-generated by Foreman's prprocessor

@theforeman-bot
Copy link
Member

@adamruzicka, the Redmine ticket used is for a different project than the one associated with this GitHub repository. Please either:

If changing the ticket number used, remember to update the PR title and the commit message (using git commit --amend).


This message was auto-generated by Foreman's prprocessor

@theforeman-bot
Copy link
Member

@adamruzicka, the Redmine ticket used is for a different project than the one associated with this GitHub repository. Please either:

If changing the ticket number used, remember to update the PR title and the commit message (using git commit --amend).


This message was auto-generated by Foreman's prprocessor

@theforeman-bot
Copy link
Member

@adamruzicka, the Redmine ticket used is for a different project than the one associated with this GitHub repository. Please either:

If changing the ticket number used, remember to update the PR title and the commit message (using git commit --amend).


This message was auto-generated by Foreman's prprocessor

if $::osfamily == 'RedHat' {
$ruby_prefix = 'rubygem-'
if $::operatingsystem != 'Fedora' {
$ruby_prefix = 'tfm-' + $ruby_prefix
Copy link
Member

Choose a reason for hiding this comment

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

This isn't valid since variables can't re-declared.

@@ -49,6 +52,23 @@
template_path => 'foreman_proxy/plugin/remote_execution_ssh.yml.erb',
}

if $ssh_kerberos_auth {
if $::osfamily == 'RedHat' {
$rh_ruby_prefix = 'rubygem'
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this additional variable is actually needed. I'd just inline string below.

$ruby_prefix = 'ruby'
}

package { "${ruby_prefix}-net-ssh-krb":
Copy link
Member

Choose a reason for hiding this comment

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

Should this restart the dynflow_core service? Note that it's only used on EL and not Fedora or other distro's.

@adamruzicka
Copy link
Contributor Author

@ekohl Sorry for taking so long, hopefully I addressed all your comments and added some tests

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

One trivial thing, other than that 👍

@@ -71,6 +78,10 @@

it { should_not contain_exec('generate_ssh_key') }
it { should_not contain_file('/root/.ssh') }

it 'should not install tfm-rubygem-net-ssh-krb package' do
Copy link
Member

Choose a reason for hiding this comment

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

nit: s/not // (the actual test is correct)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, bad copy-paste

@ekohl
Copy link
Member

ekohl commented Aug 14, 2017

@mmoll mind re-reviewing this?

@@ -49,6 +52,22 @@
template_path => 'foreman_proxy/plugin/remote_execution_ssh.yml.erb',
}

if $ssh_kerberos_auth {
if $::osfamily == 'RedHat' {
if $::operatingsystem != 'Fedora' {
Copy link
Contributor

Choose a reason for hiding this comment

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

(untested) the following looks shorter and more readable to me:

unless $::osfamily == 'RedHat' {
  $ruby_prefix = 'ruby'
} else {
  $ruby_prefix ? $::operatingsystem {
    'Fedora' => 'rubygem',
    default  => 'tfm-rubygem',
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Forgot puppet has selector expressions, changed.

@@ -49,6 +52,22 @@
template_path => 'foreman_proxy/plugin/remote_execution_ssh.yml.erb',
}

if $ssh_kerberos_auth {
unless $::osfamily == 'RedHat' {
Copy link
Member

Choose a reason for hiding this comment

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

This might be a bit picky, but in my mind if x == y is easier to read and if both true and false are present I'd prefer to use if.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I'll squash & merge when the tests are green.

@ekohl ekohl merged commit a11b521 into theforeman:master Aug 15, 2017
@ekohl
Copy link
Member

ekohl commented Aug 15, 2017

Thanks @adamruzicka!

@adamruzicka adamruzicka deleted the kerberos branch August 15, 2017 11:26
@adamruzicka
Copy link
Contributor Author

@ekohl, @mmoll Thanks for bearing with me

juliantodt pushed a commit to juliantodt/puppet-foreman_proxy that referenced this pull request Jun 25, 2018
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