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

Drop apache username/password #168

Merged
merged 1 commit into from
Sep 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions manifests/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
$expiration = $::certs::expiration,
$default_ca = $::certs::default_ca,
$ca_key_password_file = $::certs::ca_key_password_file,
$group = $::certs::group,
) inherits certs {

$apache_cert_name = "${hostname}-apache"
Expand Down Expand Up @@ -56,18 +55,14 @@
}

if $deploy {

include ::apache

certs::keypair { 'apache':
key_pair => $apache_cert_name,
key_file => $apache_key,
manage_key => true,
key_owner => $::apache::user,
key_owner => 'root',
key_group => 'root',
key_mode => '0440',
key_group => $group,
cert_file => $apache_cert,
notify => Service['httpd'],
Copy link
Member

Choose a reason for hiding this comment

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

Why remove this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd rather solve this at another layer, namely puppet-katello and puppet-foreman_proxy_content where we apply this. The benefit is that this class becomes totally self-contained. theforeman/puppet-foreman_proxy_content#138 should be merged before though. In particular theforeman/puppet-foreman_proxy_content@199b334

Copy link
Member

Choose a reason for hiding this comment

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

Okay, lets merge the other one first 👍 I'll review it later today.

}
}
}
39 changes: 39 additions & 0 deletions spec/acceptance/apache_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
require 'spec_helper_acceptance'

describe 'certs::apache' do
before(:all) do
install_repo = <<-EOS
yumrepo { 'katello':
descr => 'Katello latest',
baseurl => 'https://fedorapeople.org/groups/katello/releases/yum/latest/katello/el7/$basearch/',
gpgcheck => false,
enabled => true,
}
EOS

apply_manifest(install_repo)
end

context 'with default parameters' do
let(:pp) do
'include ::certs::apache'
end

it_behaves_like 'a idempotent resource'

describe x509_certificate('/etc/pki/katello/certs/katello-apache.crt') do
it { should be_certificate }
it { should be_valid }
it { should have_purpose 'server' }
its(:issuer) { should eq "/C=US/ST=North Carolina/L=Raleigh/O=Katello/OU=SomeOrgUnit/CN=#{fact('fqdn')}" }
its(:subject) { should eq "/C=US/ST=North Carolina/O=Katello/OU=SomeOrgUnit/CN=#{fact('fqdn')}" }
its(:keylength) { should be >= 2048 }
end

describe x509_private_key('/etc/pki/katello/private/katello-apache.key') do
it { should_not be_encrypted }
it { should be_valid }
it { should have_matching_certificate('/etc/pki/katello/certs/katello-apache.crt') }
end
end
end