Add defined type to manage plugin packages
Sahara has separate plugin packages according to the software used in the data processing cluster, and in Ubuntu we have to install the required plugin packages additionally. This introduces the defined resource type which can be used to manage plugin packages. Change-Id: I224a5e32bd20aa86e14d738efd80d88ff9505a39
This commit is contained in:
parent
743331c9f4
commit
1445e3aca7
@ -18,6 +18,7 @@ class sahara::params {
|
||||
$engine_service_name = 'openstack-sahara-engine'
|
||||
$sahara_wsgi_script_path = '/var/www/cgi-bin/sahara'
|
||||
$sahara_wsgi_script_source = '/usr/bin/sahara-wsgi-api'
|
||||
$plugin_package_name_base = 'python3-sahara-plugin-'
|
||||
}
|
||||
'Debian': {
|
||||
$common_package_name = 'sahara-common'
|
||||
@ -27,6 +28,7 @@ class sahara::params {
|
||||
$engine_service_name = 'sahara-engine'
|
||||
$sahara_wsgi_script_path = '/usr/lib/cgi-bin/sahara'
|
||||
$sahara_wsgi_script_source = '/usr/bin/sahara-wsgi-api'
|
||||
$plugin_package_name_base = 'python3-sahara-plugin-'
|
||||
}
|
||||
default: {
|
||||
fail("Unsupported osfamily: ${facts['os']['family']}")
|
||||
|
23
manifests/plugin.pp
Normal file
23
manifests/plugin.pp
Normal file
@ -0,0 +1,23 @@
|
||||
# == Define: sahara::plugin
|
||||
#
|
||||
# Sahara plugin configuration
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# (Optional) Ensure state for package
|
||||
# Defaults to 'present'.
|
||||
#
|
||||
define sahara::plugin(
|
||||
$package_ensure = 'present',
|
||||
) {
|
||||
|
||||
include sahara::deps
|
||||
include sahara::params
|
||||
|
||||
package { "sahara-plugin-${name}":
|
||||
ensure => $package_ensure,
|
||||
name => "${::sahara::params::plugin_package_name_base}${name}",
|
||||
tag => ['openstack', 'sahara-package'],
|
||||
}
|
||||
}
|
5
releasenotes/notes/plugin-7754b64caa4a80cc.yaml
Normal file
5
releasenotes/notes/plugin-7754b64caa4a80cc.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The new ``sahara::plugin`` defined resource type has been added. This can
|
||||
be used to manage plugin packages.
|
32
spec/defines/sahara_plugin_spec.rb
Normal file
32
spec/defines/sahara_plugin_spec.rb
Normal file
@ -0,0 +1,32 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'sahara::plugin' do
|
||||
let(:title) {'vanilla'}
|
||||
|
||||
shared_examples_for 'sahara::plugin' do
|
||||
|
||||
context 'with default parameters' do
|
||||
|
||||
it 'installs the plugin package' do
|
||||
is_expected.to contain_package('sahara-plugin-vanilla').with(
|
||||
:ensure => 'present',
|
||||
:name => 'python3-sahara-plugin-vanilla',
|
||||
:tag => ['openstack', 'sahara-package'],
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
it_configures 'sahara::plugin'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user