Merge "Add defined type to manage plugin packages"
This commit is contained in:
commit
9aa46d3292
@ -18,6 +18,7 @@ class sahara::params {
|
|||||||
$engine_service_name = 'openstack-sahara-engine'
|
$engine_service_name = 'openstack-sahara-engine'
|
||||||
$sahara_wsgi_script_path = '/var/www/cgi-bin/sahara'
|
$sahara_wsgi_script_path = '/var/www/cgi-bin/sahara'
|
||||||
$sahara_wsgi_script_source = '/usr/bin/sahara-wsgi-api'
|
$sahara_wsgi_script_source = '/usr/bin/sahara-wsgi-api'
|
||||||
|
$plugin_package_name_base = 'python3-sahara-plugin-'
|
||||||
}
|
}
|
||||||
'Debian': {
|
'Debian': {
|
||||||
$common_package_name = 'sahara-common'
|
$common_package_name = 'sahara-common'
|
||||||
@ -27,6 +28,7 @@ class sahara::params {
|
|||||||
$engine_service_name = 'sahara-engine'
|
$engine_service_name = 'sahara-engine'
|
||||||
$sahara_wsgi_script_path = '/usr/lib/cgi-bin/sahara'
|
$sahara_wsgi_script_path = '/usr/lib/cgi-bin/sahara'
|
||||||
$sahara_wsgi_script_source = '/usr/bin/sahara-wsgi-api'
|
$sahara_wsgi_script_source = '/usr/bin/sahara-wsgi-api'
|
||||||
|
$plugin_package_name_base = 'python3-sahara-plugin-'
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
fail("Unsupported osfamily: ${facts['os']['family']}")
|
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