Skip to content

Commit

Permalink
Handle smart proxy and plugins packaged for SCL
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Jan 9, 2020
1 parent 5560a32 commit f78b08c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
6 changes: 5 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@

case $::osfamily {
'RedHat': {
$plugin_prefix = 'rubygem-smart_proxy_'
if versioncmp($::operatingsystemmajrelease, '7') <= 0 {
$plugin_prefix = 'tfm-rubygem-smart_proxy_'
} else {
$plugin_prefix = 'rubygem-smart_proxy_'
}

$dir = '/usr/share/foreman-proxy'
$etc = '/etc'
Expand Down
8 changes: 1 addition & 7 deletions manifests/plugin/dynflow.pp
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,8 @@

if $facts['osfamily'] == 'RedHat' {

if versioncmp($facts['operatingsystemmajrelease'], '8') >= 0 {
$scl_prefix = '' # lint:ignore:empty_string_assignment
} else {
$scl_prefix = 'tfm-'
}

foreman_proxy::plugin { 'dynflow_core':
package => "${scl_prefix}${::foreman_proxy::plugin_prefix}dynflow_core",
package => "${foreman_proxy::plugin_prefix}dynflow_core",
}
~> file { '/etc/smart_proxy_dynflow_core/settings.yml':
ensure => file,
Expand Down
8 changes: 7 additions & 1 deletion spec/defines/foreman_proxy_plugin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
end

context 'no parameters' do
package = facts[:osfamily] == 'Debian' ? 'ruby-smart-proxy-myplugin' : 'rubygem-smart_proxy_myplugin'
package = if facts[:osfamily] == 'Debian'
'ruby-smart-proxy-myplugin'
elsif facts[:osfamily] == 'RedHat'
'tfm-rubygem-smart_proxy_myplugin'
else
'rubygem-smart_proxy_myplugin'
end

it 'should install the correct package' do
should contain_package(package).with_ensure('installed')
Expand Down

0 comments on commit f78b08c

Please sign in to comment.