Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Fixes #8585: Remove unused configuration from Katello module. #190

Merged
merged 1 commit into from
Mar 23, 2015
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
7 changes: 3 additions & 4 deletions Puppetfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FORGE
GIT
remote: https://github.com/Katello/puppet-candlepin
ref: master
sha: 60949d84c6dd25af72c66fabead081c945f1be1e
sha: d19eb40f425015e41d5d6c7d86cee7f6f14c3247
specs:
katello-candlepin (0.1.0)
puppetlabs-concat (>= 1.1.1)
Expand Down Expand Up @@ -93,7 +93,7 @@ GIT
GIT
remote: https://github.com/Katello/puppet-gutterball
ref: master
sha: f2663ea0bee635dae3391997434a7cfca31532f7
sha: e8dc8afbc7042dfa8d44250f77de68964eb56ec3
specs:
katello-gutterball (0.1.0)
puppetlabs-concat (>= 1.1.1)
Expand All @@ -105,13 +105,12 @@ GIT
GIT
remote: https://github.com/Katello/puppet-katello
ref: master
sha: f9406fae03d4254262495c74740af5d276c52d5a
sha: 100f49cbc7c0f3b1047e9578b48306a610af3d95
specs:
katello-katello (0.1.0)
katello-candlepin (>= 0.1.0)
katello-certs (>= 0.1.0)
katello-common (>= 0.0.1)
katello-crane (>= 0.1.0)
katello-elasticsearch (>= 0.0.1)
katello-gutterball (>= 0.1.0)
katello-pulp (>= 0.1.0)
Expand Down
1 change: 1 addition & 0 deletions modules/candlepin/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ group :test do
gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git'
gem "puppet-syntax"
gem "puppetlabs_spec_helper"
gem 'rspec', '< 3.2.0', {"platforms"=>["ruby_18"]} # https://github.com/rspec/rspec-core/issues/1864
end

group :development do
Expand Down
1 change: 1 addition & 0 deletions modules/gutterball/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ group :test do
gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git'
gem "puppet-syntax"
gem "puppetlabs_spec_helper"
gem 'rspec', '< 3.2.0', {"platforms"=>["ruby_18"]} # https://github.com/rspec/rspec-core/issues/1864
end

group :development do
Expand Down
1 change: 0 additions & 1 deletion modules/katello/.fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ fixtures:
candlepin: "git://github.com/katello/puppet-candlepin.git"
gutterball: "git://github.com/katello/puppet-gutterball.git"
pulp: "git://github.com/katello/puppet-pulp.git"
crane: "git://github.com/katello/puppet-crane.git"
elasticsearch: "git://github.com/katello/puppet-elasticsearch.git"
symlinks:
katello: "#{source_dir}"
1 change: 1 addition & 0 deletions modules/katello/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ group :test do
gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git'
gem "puppet-syntax"
gem "puppetlabs_spec_helper"
gem 'rspec', '< 3.2.0', {"platforms"=>["ruby_18"]} # https://github.com/rspec/rspec-core/issues/1864
end

group :development do
Expand Down
15 changes: 0 additions & 15 deletions modules/katello/manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@
notify => [Service['foreman-tasks'], Class['foreman::service']],
}

file { '/etc/sysconfig/katello':
content => template('katello/etc/sysconfig/katello.erb'),
owner => 'root',
group => 'root',
mode => '0644',
}

foreman::config::passenger::fragment{ 'katello':
content => template('katello/etc/httpd/conf.d/05-foreman.d/katello.conf.erb'),
ssl_content => template('katello/etc/httpd/conf.d/05-foreman-ssl.d/katello.conf.erb'),
Expand All @@ -37,12 +30,4 @@
mode => '0755',
}

file { "${katello::config_dir}/katello/client.conf":
ensure => file,
content => template('katello/client.conf.erb'),
owner => 'root',
group => 'root',
mode => '0644',
}

}
7 changes: 0 additions & 7 deletions modules/katello/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@
proxy_username => $proxy_username,
proxy_password => $proxy_password,
} ~>
class { 'crane':
cert => $certs::apache::apache_cert,
key => $certs::apache::apache_key,
ca_cert => $certs::ca_cert,
} ~>
class { 'qpid::client':
ssl => true,
ssl_cert_name => 'broker',
Expand All @@ -113,8 +108,6 @@

class { 'certs::foreman': }

class { 'katello::service': }

Service['httpd'] -> Exec['foreman-rake-db:seed']

User<|title == apache|>{groups +> $user_groups}
Expand Down
18 changes: 1 addition & 17 deletions modules/katello/manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,36 +47,20 @@
$config_dir = '/etc/foreman/plugins'
$log_dir = '/var/log/foreman/plugins'

# sysconfig settings
$job_workers = 1

# OAUTH settings
$oauth_key = 'katello'

# we set foreman oauth key to foreman, so that katello knows where the call
# comes from and can find the rigth secret. This way only one key-secret pair
# is needed to be mainained for duplex communication.
$foreman_oauth_key = 'foreman'
$oauth_token_file = 'katello_oauth_secret'
$oauth_secret = cache_data($oauth_token_file, random_password(32))

$post_sync_token = cache_data('post_sync_token', random_password(32))

# Subsystems settings
$candlepin_url = 'https://localhost:8443/candlepin'
$pulp_url = subsystem_url('pulp/api/v2/')
$foreman_url = subsystem_url('foreman')
$pulp_url = "https://${::fqdn}/pulp/api/v2/"

# database reinitialization flag
$reset_data = 'NONE'

# Delete this from configuration check
$use_foreman = false
$ldap_roles = false
$validate_ldap = false

$use_passenger = true

$qpid_url = "amqp:ssl:${::fqdn}:5671"
$candlepin_event_queue = 'katello_event_queue'
}
4 changes: 0 additions & 4 deletions modules/katello/manifests/service.pp

This file was deleted.

4 changes: 0 additions & 4 deletions modules/katello/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@
"name": "katello-pulp",
"version_requirement": ">= 0.1.0"
},
{
"name": "katello-crane",
"version_requirement": ">= 0.1.0"
},
{
"name": "katello-elasticsearch",
"version_requirement": ">= 0.0.1"
Expand Down
78 changes: 75 additions & 3 deletions modules/katello/spec/classes/katello_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,94 @@
describe 'katello::config' do
let :facts do
{
:concat_basedir => '/tmp',
:interfaces => '',
:concat_basedir => '/tmp',
:interfaces => '',
:osfamily => 'RedHat',
:operatingsystem => 'CentOS',
:operatingsystemrelease => '6.5',
:fqdn => 'host.example.org',
}
end

context 'default config settings' do
let(:pre_condition) do
['include foreman','include certs']
[
'include foreman',
'include certs',
'class {"katello":' \
'post_sync_token => test_token,' \
'oauth_secret => secret' \
'}'
]
end

it 'should NOT set the cdn-ssl-version' do
should_not contain_file('/etc/foreman/plugins/katello.yaml').
with_content(/cdn_ssl_version/)
end

it 'should generate correct katello.yaml' do
should contain_file('/etc/foreman/plugins/katello.yaml')
content = catalogue.resource('file', '/etc/foreman/plugins/katello.yaml').send(:parameters)[:content]
content.split("\n").reject { |c| c =~ /(^#|^$)/ }.should == [
'common:',
' rest_client_timeout: 120',
' post_sync_url: https://localhost/katello/api/v2/repositories/sync_complete?token=test_token',
' candlepin:',
' url: https://localhost:8443/candlepin',
' oauth_key: katello',
' oauth_secret: secret',
' pulp:',
" url: https://#{facts[:fqdn]}/pulp/api/v2/",
' oauth_key: katello',
' oauth_secret: secret',
' qpid:',
" url: amqp:ssl:#{facts[:fqdn]}:5671",
' subscriptions_queue_address: katello_event_queue'
]
end
end

context 'when http proxy parameters are specified' do
let(:pre_condition) do
[
'include foreman',
'include certs',
'class {"katello":' \
'post_sync_token => "test_token",' \
'oauth_secret => "secret",' \
'proxy_url => "http://myproxy.org",' \
'proxy_port => 8888,' \
'proxy_username => "admin",' \
'proxy_password => "secret_password"' \
'}'
]
end

it 'should generate correct katello.yaml' do
should contain_file('/etc/foreman/plugins/katello.yaml')
content = catalogue.resource('file', '/etc/foreman/plugins/katello.yaml').send(:parameters)[:content]
content.split("\n").reject { |c| c =~ /(^#|^$)/ }.should == [
'common:',
' rest_client_timeout: 120',
' post_sync_url: https://localhost/katello/api/v2/repositories/sync_complete?token=test_token',
' candlepin:',
' url: https://localhost:8443/candlepin',
' oauth_key: katello',
' oauth_secret: secret',
' pulp:',
" url: https://#{facts[:fqdn]}/pulp/api/v2/",
' oauth_key: katello',
' oauth_secret: secret',
' qpid:',
" url: amqp:ssl:#{facts[:fqdn]}:5671",
' subscriptions_queue_address: katello_event_queue',
' cdn_proxy:',
' host: http://myproxy.org',
' port: 8888',
' user: admin',
' password: secret_password'
]
end
end
end
5 changes: 0 additions & 5 deletions modules/katello/spec/classes/katello_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

it { should contain_class('katello::install') }
it { should contain_class('katello::config') }
it { should contain_class('katello::service') }

it "should configure a qpid client" do
should contain_class('qpid::client').
Expand Down Expand Up @@ -57,7 +56,6 @@

it { should contain_class('katello::install') }
it { should contain_class('katello::config') }
it { should contain_class('katello::service') }
end

context 'on oel' do
Expand All @@ -77,7 +75,6 @@

it { should contain_class('katello::install') }
it { should contain_class('katello::config') }
it { should contain_class('katello::service') }
end

context 'on fedora' do
Expand All @@ -97,7 +94,6 @@

it { should contain_class('katello::install') }
it { should contain_class('katello::config') }
it { should contain_class('katello::service') }
end

context 'on sl' do
Expand All @@ -117,7 +113,6 @@

it { should contain_class('katello::install') }
it { should contain_class('katello::config') }
it { should contain_class('katello::service') }
end

context 'on unsupported osfamily' do
Expand Down
48 changes: 3 additions & 45 deletions modules/katello/templates/katello.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,24 @@
# see /usr/share/katello/config.katello_defaults.yml for available options

common:
app_mode: 'katello'
<%- if @cdn_ssl_version && !@cdn_ssl_version.strip.empty?-%>
cdn_ssl_version: <%= @cdn_ssl_version %>
<%- end -%>

warden: <%= scope.lookupvar("katello::params::auth_method") %>
ldap_roles: <%= scope.lookupvar("katello::params::ldap_roles") %>
validate_ldap: <%= scope.lookupvar("katello::params::validate_ldap") %>
rest_client_timeout: 120

url_prefix: <%= @deployment_url %>
host: <%= has_variable?("fqdn") ? @fqdn : hostname %>
port:
use_ssl: true
use_foreman: <%= scope.lookupvar("katello::params::use_foreman") %>

post_sync_url: https://localhost<%= scope.lookupvar("katello::params::deployment_url") %>/api/v2/repositories/sync_complete?token=<%= scope.lookupvar("post_sync_token") %>
post_sync_url: https://localhost<%= @deployment_url %>/api/v2/repositories/sync_complete?token=<%= @post_sync_token %>

candlepin:
url: <%= scope.lookupvar("katello::params::candlepin_url") %>
url: <%= @candlepin_url %>
oauth_key: <%= @oauth_key %>
oauth_secret: <%= @oauth_secret %>

pulp:
url: <%= scope.lookupvar("katello::params::pulp_url") %>
url: <%= @pulp_url %>
oauth_key: <%= @oauth_key %>
oauth_secret: <%= @oauth_secret %>

foreman:
url: <%= scope.lookupvar("katello::params::foreman_url") %>
oauth_key: <%= scope.lookupvar("katello::params::foreman_oauth_key") %>
oauth_secret: <%= scope.lookupvar("katello::params::oauth_secret") %>

cloud_forms:
oauth_key: <%= scope.lookupvar("katello::params::oauth_key") %>
oauth_secret: <%= scope.lookupvar("katello::params::oauth_secret") %>

qpid:
url: <%= @qpid_url %>
subscriptions_queue_address: <%= @candlepin_event_queue %>
Expand All @@ -60,26 +41,3 @@ common:
user: <%= @proxy_username %>
password: <%= @proxy_password %>
<%- end -%>

ldap_fluff_config:
host: <%= scope.lookupvar("katello::params::ldap_server") %>
port: <%= scope.lookupvar("katello::params::ldap_port") %>
encryption: <%= scope.lookupvar("katello::params::ldap_encryption") %>
base_dn: <%= scope.lookupvar("katello::params::ldap_users_basedn") %>
group_base: <%= scope.lookupvar("katello::params::ldap_groups_basedn") %>
server_type: <%= scope.lookupvar("katello::params::ldap_server_type") %>
service_user: <%= scope.lookupvar("katello::params::ldap_service_user") %>
service_pass: <%= scope.lookupvar("katello::params::ldap_service_pass") %>
anon_queries: <%= scope.lookupvar("katello::params::ldap_anon_queries") %>
ad_domain: <%= scope.lookupvar("katello::params::ldap_ad_domain") %>

# authentication
sso:
<%- if scope.lookupvar("katello::params::deployment") == 'katello' -%>
enable: true
<%- end -%>
<%- if scope.lookupvar("katello::params::deployment") == 'headpin' -%>
enable: false
<%- end -%>
provider_url: https://<%= scope.lookupvar('fqdn') -%>/signo
logout_path: /logout