Merge pull request #11 from bodepd/redhat_support

Add Redhat support
This commit is contained in:
Dan Bode 2012-11-05 22:40:10 -08:00
commit bd9853a2bf
5 changed files with 45 additions and 19 deletions

View File

@ -16,12 +16,15 @@ class cinder::api (
Cinder_config<||> ~> Service['cinder-api']
Cinder_config<||> ~> Exec['cinder-manage db_sync']
Cinder_api_paste_ini<||> ~> Service['cinder-api']
Package['cinder-api'] -> Cinder_config<||>
Package['cinder-api'] -> Cinder_api_paste_ini<||>
package { 'cinder-api':
name => $::cinder::params::api_package,
ensure => $package_ensure,
if $::cinder::params::api_package {
Package['cinder-api'] -> Cinder_config<||>
Package['cinder-api'] -> Cinder_api_paste_ini<||>
Package['cinder-api'] -> Service['cinder-api']
package { 'cinder-api':
name => $::cinder::params::api_package,
ensure => $package_ensure,
}
}
if $enabled {
@ -34,7 +37,7 @@ class cinder::api (
name => $::cinder::params::api_service,
enable => $enabled,
ensure => $ensure,
require => Package[$::cinder::params::api_package],
require => Package['cinder'],
}
if $keystone_enabled {

View File

@ -2,6 +2,7 @@ class cinder::client(
$package_ensure = 'present'
) {
package { 'python-cinderclient':
name => $::cinder::params::client_package,
ensure => $package_ensure,
}
}

View File

@ -6,6 +6,7 @@ class cinder::params {
if $::osfamily == 'Debian' {
$package_name = 'cinder-common'
$client_package = 'python-cinderclient'
$api_package = 'cinder-api'
$api_service = 'cinder-api'
$scheduler_package = 'cinder-scheduler'
@ -16,6 +17,21 @@ class cinder::params {
$tgt_package_name = 'tgt'
$tgt_service_name = 'tgt'
} elsif($::osfamily == 'RedHat') {
$package_name = 'openstack-cinder'
$client_package = 'python-cinderclient'
$api_package = false
$api_service = 'openstack-cinder-api'
$scheduler_package = false
$scheduler_service = 'openstack-cinder-scheduler'
$volume_package = false
$volume_service = 'openstack-cinder-volume'
$db_sync_command = 'cinder-manage db sync'
$tgt_package_name = 'scsi-target-utils'
$tgt_service_name = 'tgtd'
} else {
fail("unsuported osfamily ${::osfamily}, currently Debian is the only supported platform")
}

View File

@ -6,14 +6,17 @@ class cinder::scheduler (
include cinder::params
Package['cinder-scheduler'] -> Cinder_config<||>
Package['cinder-scheduler'] -> Cinder_api_paste_ini<||>
Cinder_api_paste_ini<||> ~> Service['cinder-scheduler']
Exec<| title == 'cinder-manage db_sync' |> ~> Service['cinder-scheduler']
package { 'cinder-scheduler':
name => $::cinder::params::scheduler_package,
ensure => $package_ensure,
if $::cinder::params::scheduler_package {
Package['cinder-scheduler'] -> Cinder_config<||>
Package['cinder-scheduler'] -> Cinder_api_paste_ini<||>
Package['cinder-scheduler'] -> Service['cinder-scheduler']
package { 'cinder-scheduler':
name => $::cinder::params::scheduler_package,
ensure => $package_ensure,
}
}
if $enabled {
@ -26,7 +29,7 @@ class cinder::scheduler (
name => $::cinder::params::scheduler_service,
enable => $enabled,
ensure => $ensure,
require => Package[$::cinder::params::scheduler_package],
require => Package['cinder'],
subscribe => File[$::cinder::params::cinder_conf],
}
}

View File

@ -6,15 +6,18 @@ class cinder::volume (
include cinder::params
Package['cinder-volume'] -> Cinder_config<||>
Package['cinder-volume'] -> Cinder_api_paste_ini<||>
Package['cinder'] -> Package['cinder-volume']
Cinder_config<||> ~> Service['cinder-volume']
Cinder_api_paste_ini<||> ~> Service['cinder-volume']
package { 'cinder-volume':
name => $::cinder::params::volume_package,
ensure => $package_ensure,
if $::cinder::params::volume_package {
Package['cinder-volume'] -> Cinder_config<||>
Package['cinder-volume'] -> Cinder_api_paste_ini<||>
Package['cinder'] -> Package['cinder-volume']
Package['cinder-volume'] -> Service['cinder-volume']
package { 'cinder-volume':
name => $::cinder::params::volume_package,
ensure => $package_ensure,
}
}
if $enabled {
@ -27,7 +30,7 @@ class cinder::volume (
name => $::cinder::params::volume_service,
enable => $enabled,
ensure => $ensure,
require => Package['cinder-volume'],
require => Package['cinder'],
subscribe => File[$::cinder::params::cinder_conf],
}