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

View File

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

View File

@ -6,6 +6,7 @@ class cinder::params {
if $::osfamily == 'Debian' { if $::osfamily == 'Debian' {
$package_name = 'cinder-common' $package_name = 'cinder-common'
$client_package = 'python-cinderclient'
$api_package = 'cinder-api' $api_package = 'cinder-api'
$api_service = 'cinder-api' $api_service = 'cinder-api'
$scheduler_package = 'cinder-scheduler' $scheduler_package = 'cinder-scheduler'
@ -16,6 +17,21 @@ class cinder::params {
$tgt_package_name = 'tgt' $tgt_package_name = 'tgt'
$tgt_service_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 { } else {
fail("unsuported osfamily ${::osfamily}, currently Debian is the only supported platform") fail("unsuported osfamily ${::osfamily}, currently Debian is the only supported platform")
} }

View File

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

View File

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