Allow distro packages to install dependencies, etc
This patch updates init.pp so that it only attempts to install the mistral package (which should create the user, group, and install all the required dependencies itself). Includes tests for each supported OS Family. Change-Id: I3f996cddb5ff31431545e2f8e4a376fccc2eda61
This commit is contained in:
parent
636104b0bb
commit
90837cd2ec
@ -3,6 +3,10 @@
|
||||
# Full description of class mistral here.
|
||||
#
|
||||
# === Parameters
|
||||
# [*package_ensure*]
|
||||
# (Optional) Ensure state for package.
|
||||
# Defaults to 'present'
|
||||
#
|
||||
# [*qpid_hostname*]
|
||||
# The name/ip of qpid. Default 'localhost'
|
||||
#
|
||||
@ -70,6 +74,7 @@
|
||||
# Keystone protocol
|
||||
#
|
||||
class mistral(
|
||||
$package_ensure = 'present',
|
||||
$qpid_hostname = 'localhost',
|
||||
$qpid_port = 5671,
|
||||
$qpid_username = 'guest',
|
||||
@ -94,156 +99,10 @@ class mistral(
|
||||
){
|
||||
include ::mistral::params
|
||||
|
||||
group { 'mistral':
|
||||
ensure => 'present',
|
||||
name => 'mistral',
|
||||
}
|
||||
|
||||
file { '/home/mistral' :
|
||||
ensure => directory,
|
||||
owner => 'mistral',
|
||||
group => 'mistral',
|
||||
mode => '0750',
|
||||
}
|
||||
|
||||
user { 'mistral':
|
||||
name => 'mistral',
|
||||
gid => 'mistral',
|
||||
groups => ['mistral'],
|
||||
home => '/home/mistral',
|
||||
system => true
|
||||
}
|
||||
|
||||
|
||||
package { 'MySQL-python':
|
||||
ensure => installed,
|
||||
name => 'MySQL-python',
|
||||
}
|
||||
|
||||
package { 'python-devel':
|
||||
ensure => installed,
|
||||
name => 'python-devel',
|
||||
}
|
||||
|
||||
package { 'python-pip':
|
||||
ensure => installed,
|
||||
name => 'python-pip',
|
||||
}
|
||||
|
||||
package { 'python-keystonemiddleware':
|
||||
ensure => latest,
|
||||
name => 'python-keystonemiddleware',
|
||||
}
|
||||
|
||||
package { 'python-oslo-utils':
|
||||
ensure => latest,
|
||||
name => 'python-oslo-utils',
|
||||
}
|
||||
|
||||
package { 'python-oslo-db':
|
||||
ensure => latest,
|
||||
name => 'python-oslo-db',
|
||||
}
|
||||
|
||||
package { 'python-oslo-log':
|
||||
ensure => latest,
|
||||
name => 'python-oslo-log',
|
||||
}
|
||||
|
||||
package { 'python-oslo-service':
|
||||
ensure => latest,
|
||||
name => 'python-oslo-service',
|
||||
}
|
||||
|
||||
package { 'python-oslo-i18n':
|
||||
ensure => latest,
|
||||
name => 'python-oslo-i18n',
|
||||
}
|
||||
|
||||
package { 'python-oslo-config':
|
||||
ensure => latest,
|
||||
name => 'python-oslo-config',
|
||||
}
|
||||
|
||||
package { 'python-oslo-messaging':
|
||||
ensure => latest,
|
||||
name => 'python-oslo-messaging',
|
||||
}
|
||||
|
||||
package { 'python-oslo-context':
|
||||
ensure => latest,
|
||||
name => 'python-oslo-context',
|
||||
}
|
||||
|
||||
package { 'python-oslo-serialization':
|
||||
ensure => latest,
|
||||
name => 'python-oslo-serialization',
|
||||
}
|
||||
|
||||
package { 'python-novaclient':
|
||||
ensure => latest,
|
||||
name => 'python-novaclient',
|
||||
}
|
||||
|
||||
package { 'python-eventlet':
|
||||
ensure => latest,
|
||||
name => 'python-eventlet',
|
||||
}
|
||||
|
||||
|
||||
package { 'yaql':
|
||||
ensure => installed,
|
||||
name => 'yaql',
|
||||
}
|
||||
|
||||
package { 'python-pecan':
|
||||
ensure => latest,
|
||||
name => 'python-pecan',
|
||||
}
|
||||
|
||||
package { 'python-ply':
|
||||
ensure => installed,
|
||||
name => 'python-ply',
|
||||
}
|
||||
|
||||
package { 'python-jsonschema':
|
||||
ensure => installed,
|
||||
name => 'python-jsonschema',
|
||||
}
|
||||
|
||||
package { 'python-croniter':
|
||||
ensure => installed,
|
||||
name => 'python-croniter',
|
||||
}
|
||||
|
||||
package { 'python-networkx':
|
||||
ensure => installed,
|
||||
name => 'python-networkx',
|
||||
}
|
||||
|
||||
package { 'python-warlock':
|
||||
ensure => installed,
|
||||
name => 'python-warlock',
|
||||
}
|
||||
|
||||
package { 'python-cliff':
|
||||
ensure => installed,
|
||||
name => 'python-cliff',
|
||||
}
|
||||
|
||||
package { 'python-wsme':
|
||||
ensure => installed,
|
||||
name => 'python-wsme',
|
||||
}
|
||||
|
||||
package { 'python-paramiko':
|
||||
ensure => installed,
|
||||
name => 'python-paramiko',
|
||||
}
|
||||
|
||||
package { 'mistral':
|
||||
ensure => latest,
|
||||
name => 'mistral',
|
||||
package { 'mistral-common':
|
||||
ensure => $package_ensure,
|
||||
name => $::mistral::params::common_package_name,
|
||||
tag => ['openstack', 'mistral-package'],
|
||||
}
|
||||
|
||||
$database_connection = "mysql://mistral:${mistral_db_pass}@${mysql_vip}/mistral"
|
||||
@ -278,4 +137,3 @@ class mistral(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,26 @@
|
||||
# == Class: mistral::params
|
||||
#
|
||||
# Parameters for puppet-mistral
|
||||
#
|
||||
class mistral::params {
|
||||
$mistral_conf_dir = '/etc/mistral'
|
||||
$mistral_conf = "${mistral_conf_dir}/mistral.conf"
|
||||
$package_name = 'mistral'
|
||||
$client_package = 'python-mistralclient'
|
||||
$log_dir ='/var/log/mistral'
|
||||
$dbsync_command = "/usr/bin/python /usr/bin/mistral-db-manage --config-file=${mistral_conf} populate"
|
||||
$update_service_command = '/usr/bin/systemctl daemon-reload'
|
||||
|
||||
case $::osfamily {
|
||||
'RedHat': {
|
||||
$common_package_name = 'openstack-mistral-common'
|
||||
}
|
||||
'Debian': {
|
||||
$common_package_name = 'mistral'
|
||||
}
|
||||
default: {
|
||||
fail("Unsupported osfamily: ${::osfamily} operatingsystem: \
|
||||
${::operatingsystem}, module ${module_name} only support osfamily \
|
||||
RedHat and Debian")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ describe 'mistral' do
|
||||
}
|
||||
end
|
||||
|
||||
shared_examples_for 'a mistral base installation' do
|
||||
shared_examples_for 'mistral' do
|
||||
|
||||
it { is_expected.to contain_class('mistral::params') }
|
||||
|
||||
@ -21,5 +21,38 @@ describe 'mistral' do
|
||||
is_expected.to contain_mistral_config('keystone_authtoken/identity_uri').with_value( params[:identity_uri] )
|
||||
end
|
||||
|
||||
it 'installs mistral package' do
|
||||
is_expected.to contain_package('mistral-common').with(
|
||||
:ensure => 'present',
|
||||
:name => platform_params[:common_package_name],
|
||||
:tag => ['openstack', 'mistral-package'],
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'Debian' }
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
{ :common_package_name => 'mistral' }
|
||||
end
|
||||
|
||||
it_configures 'mistral'
|
||||
end
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
{ :osfamily => 'RedHat' }
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
{ :common_package_name => 'openstack-mistral-common' }
|
||||
end
|
||||
|
||||
it_configures 'mistral'
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user