diff --git a/Puppetfile.lock b/Puppetfile.lock index efe96067..58ebc9c0 100644 --- a/Puppetfile.lock +++ b/Puppetfile.lock @@ -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) @@ -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) @@ -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) diff --git a/modules/candlepin/Gemfile b/modules/candlepin/Gemfile index 1a01c128..9eaa9101 100644 --- a/modules/candlepin/Gemfile +++ b/modules/candlepin/Gemfile @@ -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 diff --git a/modules/gutterball/Gemfile b/modules/gutterball/Gemfile index 1a01c128..9eaa9101 100644 --- a/modules/gutterball/Gemfile +++ b/modules/gutterball/Gemfile @@ -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 diff --git a/modules/katello/.fixtures.yml b/modules/katello/.fixtures.yml index 8fedcf46..e02afa7d 100644 --- a/modules/katello/.fixtures.yml +++ b/modules/katello/.fixtures.yml @@ -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}" diff --git a/modules/katello/Gemfile b/modules/katello/Gemfile index 1a01c128..9eaa9101 100644 --- a/modules/katello/Gemfile +++ b/modules/katello/Gemfile @@ -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 diff --git a/modules/katello/manifests/config.pp b/modules/katello/manifests/config.pp index 43f2f46a..7e3e5677 100644 --- a/modules/katello/manifests/config.pp +++ b/modules/katello/manifests/config.pp @@ -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'), @@ -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', - } - } diff --git a/modules/katello/manifests/init.pp b/modules/katello/manifests/init.pp index 76c24060..aa3257da 100644 --- a/modules/katello/manifests/init.pp +++ b/modules/katello/manifests/init.pp @@ -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', @@ -113,8 +108,6 @@ class { 'certs::foreman': } - class { 'katello::service': } - Service['httpd'] -> Exec['foreman-rake-db:seed'] User<|title == apache|>{groups +> $user_groups} diff --git a/modules/katello/manifests/params.pp b/modules/katello/manifests/params.pp index 245c3b1a..105a6ad8 100644 --- a/modules/katello/manifests/params.pp +++ b/modules/katello/manifests/params.pp @@ -47,16 +47,8 @@ $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)) @@ -64,19 +56,11 @@ # 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' } diff --git a/modules/katello/manifests/service.pp b/modules/katello/manifests/service.pp deleted file mode 100644 index 08e736e9..00000000 --- a/modules/katello/manifests/service.pp +++ /dev/null @@ -1,4 +0,0 @@ -# Katello Services -class katello::service { - include pulp::service -} diff --git a/modules/katello/metadata.json b/modules/katello/metadata.json index c9e2d903..718b890d 100644 --- a/modules/katello/metadata.json +++ b/modules/katello/metadata.json @@ -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" diff --git a/modules/katello/spec/classes/katello_config_spec.rb b/modules/katello/spec/classes/katello_config_spec.rb index acf04afc..fa9b43ec 100644 --- a/modules/katello/spec/classes/katello_config_spec.rb +++ b/modules/katello/spec/classes/katello_config_spec.rb @@ -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 diff --git a/modules/katello/spec/classes/katello_spec.rb b/modules/katello/spec/classes/katello_spec.rb index 2e910441..26a5a30c 100644 --- a/modules/katello/spec/classes/katello_spec.rb +++ b/modules/katello/spec/classes/katello_spec.rb @@ -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'). @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/modules/katello/templates/katello.yml.erb b/modules/katello/templates/katello.yml.erb index 83b9d4ff..de8a7278 100644 --- a/modules/katello/templates/katello.yml.erb +++ b/modules/katello/templates/katello.yml.erb @@ -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 %> @@ -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