Add support to remove horizon dashboards
The initial implemention assumed you wanted to install dashboard. This adds support to remove/uninstall dashboard with the resource. Change-Id: Ie008d805a05d8152721220ffdf7c29f3afc65baa
This commit is contained in:
parent
a0468fd8cb
commit
d5faba4205
@ -20,12 +20,20 @@
|
||||
# This resource installs additional horizon dashboard which is not
|
||||
# shipped with the horizon packages, but as additional packages.
|
||||
#
|
||||
# == Parameters:
|
||||
#
|
||||
# [*ensure*]
|
||||
# (Optional) The ensure state of the dashboard package.
|
||||
# Defaults to present
|
||||
#
|
||||
# == Example:
|
||||
#
|
||||
# This will install the correct heat-dashboard package for your deployment.
|
||||
# horizon::dashboard { 'heat': }
|
||||
#
|
||||
define horizon::dashboard {
|
||||
define horizon::dashboard (
|
||||
$ensure = 'present',
|
||||
) {
|
||||
|
||||
$dashboard = downcase($name)
|
||||
|
||||
@ -45,7 +53,7 @@ define horizon::dashboard {
|
||||
}
|
||||
|
||||
ensure_packages($dashboard_package_name, {
|
||||
'ensure' => present,
|
||||
'ensure' => $ensure,
|
||||
'tag' => ['horizon-dashboard-package']
|
||||
})
|
||||
}
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Added ``ensure`` parameter to ``horizon::dashboard`` resource which defaults
|
||||
to ``present``. You can now set this to absent if you want to remove a horizon
|
||||
dashboard package.
|
@ -24,11 +24,23 @@ describe 'horizon::dashboard' do
|
||||
|
||||
shared_examples 'horizon::dashboard' do
|
||||
context 'with default' do
|
||||
it {
|
||||
is_expected.to contain_package(platform_params[:heat_dashboard_package_name]).with(
|
||||
it { should contain_package(platform_params[:heat_dashboard_package_name]).with(
|
||||
:ensure => 'present',
|
||||
:tag => ['horizon-dashboard-package'])
|
||||
}
|
||||
:tag => ['horizon-dashboard-package']
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with absent' do
|
||||
let :params do
|
||||
{
|
||||
:ensure => 'absent',
|
||||
}
|
||||
end
|
||||
|
||||
it { should contain_package(platform_params[:heat_dashboard_package_name]).with(
|
||||
:ensure => 'absent',
|
||||
:tag => ['horizon-dashboard-package']
|
||||
)}
|
||||
end
|
||||
end
|
||||
|
||||
@ -38,21 +50,19 @@ describe 'horizon::dashboard' do
|
||||
end
|
||||
|
||||
context 'with default' do
|
||||
it {
|
||||
is_expected.to contain_package('python3-heat-dashboard').with(
|
||||
:ensure => 'present',
|
||||
:tag => ['horizon-dashboard-package'])
|
||||
}
|
||||
it { should contain_package('python3-heat-dashboard').with(
|
||||
:ensure => 'present',
|
||||
:tag => ['horizon-dashboard-package']
|
||||
)}
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples 'horizon::dashboard on Ubuntu' do
|
||||
context 'with default' do
|
||||
it {
|
||||
is_expected.to contain_package('python-heat-dashboard').with(
|
||||
it { should contain_package('python-heat-dashboard').with(
|
||||
:ensure => 'present',
|
||||
:tag => ['horizon-dashboard-package'])
|
||||
}
|
||||
:tag => ['horizon-dashboard-package']
|
||||
)}
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user