From 74b2e30c6fe03c251e06a10e70a3be2e7732ff25 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 5 Mar 2020 13:40:23 +0100 Subject: [PATCH] Use foreman::plugin to define the plugin Since version 15.0.0 the define does everything this module needs in the correct order. --- manifests/application.pp | 14 ++++---------- manifests/globals.pp | 6 ------ metadata.json | 2 +- spec/classes/application_spec.rb | 3 ++- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/manifests/application.pp b/manifests/application.pp index cc3c0592..f93aad14 100644 --- a/manifests/application.pp +++ b/manifests/application.pp @@ -70,16 +70,10 @@ # Katello database seeding needs candlepin Anchor <| title == 'katello::repo' or title == 'katello::candlepin' |> -> - package { $katello::params::rubygem_katello: - ensure => installed, - } -> - file { "${foreman::plugin_config_dir}/katello.yaml": - ensure => file, - owner => 'root', - group => $foreman::group, - mode => '0640', - content => template('katello/katello.yaml.erb'), - notify => [Class['foreman::service'], Foreman::Rake['db:seed'], Foreman::Rake['apipie:cache:index']], + foreman::plugin { 'katello': + package => $foreman::plugin_prefix.regsubst(/foreman_/, 'katello'), + config => template('katello/katello.yaml.erb'), + config_file => "${foreman::plugin_config_dir}/katello.yaml", } foreman::config::apache::fragment { 'katello': diff --git a/manifests/globals.pp b/manifests/globals.pp index a363be0c..ae177c4d 100644 --- a/manifests/globals.pp +++ b/manifests/globals.pp @@ -26,12 +26,6 @@ Boolean $enable_docker = true, Boolean $enable_deb = true, ) { - if versioncmp($facts['operatingsystemmajrelease'], '8') >= 0 { - $rubygem_katello = 'rubygem-katello' - } else { - $rubygem_katello = 'tfm-rubygem-katello' - } - # OAUTH settings $candlepin_oauth_key = 'katello' $candlepin_oauth_secret = extlib::cache_data('foreman_cache_data', 'candlepin_oauth_secret', extlib::random_password(32)) diff --git a/metadata.json b/metadata.json index c62115e7..07fde3f9 100644 --- a/metadata.json +++ b/metadata.json @@ -38,7 +38,7 @@ }, { "name": "theforeman/foreman", - "version_requirement": ">= 14.0.0 < 15.0.0" + "version_requirement": ">= 15.0.0 < 16.0.0" } ], "requirements": [ diff --git a/spec/classes/application_spec.rb b/spec/classes/application_spec.rb index 8fa7fdd9..0bf61f13 100644 --- a/spec/classes/application_spec.rb +++ b/spec/classes/application_spec.rb @@ -40,7 +40,8 @@ class { 'katello::params': it do is_expected.to contain_file('/etc/foreman/plugins/katello.yaml') - .that_notifies(['Class[Foreman::Service]', 'Exec[foreman-rake-db:seed]']) + .that_notifies('Class[Foreman::Service]') + .that_comes_before('Foreman::Rake[db:seed]') end it do