From 87a5091e3ae0f1d11d217be03cbb6bb302668942 Mon Sep 17 00:00:00 2001 From: vagrant Date: Fri, 27 May 2011 11:25:26 -0700 Subject: [PATCH] removed the confighash changed isserviceenabled flag to enable. - updated it to effect ensure and enable state of service --- nova/manifests/all.pp | 31 ++++++------------------------- nova/manifests/api.pp | 12 ++++++++++-- nova/manifests/init.pp | 7 ++++--- nova/manifests/network.pp | 12 ++++++++++-- nova/manifests/objectstore.pp | 12 ++++++++++-- nova/manifests/scheduler.pp | 12 ++++++++++-- nova/tests/api.pp | 26 +++----------------------- nova/tests/compute.pp | 31 +++---------------------------- nova/tests/network.pp | 28 +++++----------------------- nova/tests/objectstore.pp | 28 +++++----------------------- nova/tests/scheduler.pp | 28 +++++----------------------- 11 files changed, 71 insertions(+), 156 deletions(-) diff --git a/nova/manifests/all.pp b/nova/manifests/all.pp index f718d1d96..ca6eb4031 100644 --- a/nova/manifests/all.pp +++ b/nova/manifests/all.pp @@ -18,31 +18,12 @@ class nova::all( $ipv6_backend = 'account_identifier' ) { - $novaConfFlags = { - verbose => $verbose, - nodaemon => $nodaemon, - sql_connection => $sql_connetion, - network_manager => $network_manager, - image_service => $image_service, - flat_network_bridge => $flat_network_bridge, - connection_type => $connection_type, - xenapi_connection_url => $xenapi_connection_url, - xenapi_connection_username => $xenapi_connection_username, - xenapi_connection_password => $xenapi_connection_password, - xenapi_inject_image => $xenapi_inject_image, - rescue_timeout => $resuce_timeout, - allow_admin_api => $allow_admin_api, - xenapi_inject_image => $xenapi_inject_image, - use_ipv6 => $use_ipv6, - flat_injected => $flat_injected, - ipv6_backend => $ipv6_backend - } - class { "nova": novaConfHash => $novaConfFlags } - class { "nova::api": isServiceEnabled => false } - class { "nova::compute": isServiceEnabled => false } - class { "nova::network": isServiceEnabled => false } - class { "nova::objectstore": isServiceEnabled => false } - class { "nova::scheduler": isServiceEnabled => false } + class { "nova": } + class { "nova::api": enabled => false } + class { "nova::compute": enabled => false } + class { "nova::network": enabled => false } + class { "nova::objectstore": enabled => false } + class { "nova::scheduler": enabled => false } class { 'nova::db': password => 'password', name => 'nova', diff --git a/nova/manifests/api.pp b/nova/manifests/api.pp index 31101c66f..24ae5ec35 100644 --- a/nova/manifests/api.pp +++ b/nova/manifests/api.pp @@ -1,10 +1,18 @@ -class nova::api($isServiceEnabled=false) inherits nova { +class nova::api($enabled=false) inherits nova { + + if $enabled { + $service_ensure = 'running' + } else { + $service_ensure = 'stopped' + } + package { "nova-api": ensure => present, require => Package["python-greenlet"] } service { "nova-api": - ensure => $isServiceEnabled, + ensure => $service_ensure, + enable => $enabled, require => Package["nova-api"], subscribe => File["/etc/nova/nova.conf"] } diff --git a/nova/manifests/init.pp b/nova/manifests/init.pp index e1a098c2a..6d0caa0d7 100644 --- a/nova/manifests/init.pp +++ b/nova/manifests/init.pp @@ -1,9 +1,10 @@ class nova( $verbose = false, - $nodaemon = false, - sql_connection, + $nodaemon = false + $logdir = '' + $sql_connection, # just for network? - network_manager + $network_manager ) { class { 'puppet': } diff --git a/nova/manifests/network.pp b/nova/manifests/network.pp index 26e8b98d8..1e313bc05 100644 --- a/nova/manifests/network.pp +++ b/nova/manifests/network.pp @@ -1,11 +1,19 @@ -class nova::network( $isServiceEnabled=false ) inherits nova { +class nova::network( $enabled=false ) inherits nova { + + if $enabled { + $service_ensure = 'running' + } else { + $service_ensure = 'stopped' + } + package { "nova-network": ensure => present, require => Package["python-greenlet"] } service { "nova-network": - ensure => $isServiceEnabled, + ensure => $service_ensure, + enable => $enabled, require => Package["nova-network"], subscribe => File["/etc/nova/nova.conf"] } diff --git a/nova/manifests/objectstore.pp b/nova/manifests/objectstore.pp index 76ec1dc4f..0bdafd913 100644 --- a/nova/manifests/objectstore.pp +++ b/nova/manifests/objectstore.pp @@ -1,11 +1,19 @@ -class nova::objectstore( $isServiceEnabled=false ) inherits nova { +class nova::objectstore( $enabled=false ) inherits nova { + + if $enabled { + $service_ensure = 'running' + } else { + $service_ensure = 'stopped' + } + package { "nova-objectstore": ensure => present, require => Package["python-greenlet"] } service { "nova-objectstore": - ensure => $isServiceEnabled, + ensure => $service_ensure, + enable => $enabled, require => Package["nova-objectstore"], subscribe => File["/etc/nova/nova.conf"] } diff --git a/nova/manifests/scheduler.pp b/nova/manifests/scheduler.pp index 15fb806cd..b76c680ac 100644 --- a/nova/manifests/scheduler.pp +++ b/nova/manifests/scheduler.pp @@ -1,11 +1,19 @@ -class nova::scheduler( $isServiceEnabled ) inherits nova { +class nova::scheduler( $enabled ) inherits nova { + + if $enabled { + $service_ensure = 'running' + } else { + $service_ensure = 'stopped' + } + package { "nova-scheduler": ensure => present, require => Package["python-greenlet"] } service { "nova-scheduler": - ensure => $isServiceEnabled, + ensure => $service_ensure, + enable => $enabled, require => Package["nova-scheduler"], subscribe => File["/etc/nova/nova.conf"] } diff --git a/nova/tests/api.pp b/nova/tests/api.pp index fbff6991d..7e1df903e 100644 --- a/nova/tests/api.pp +++ b/nova/tests/api.pp @@ -1,24 +1,4 @@ -class nova-api-test { - $novaConfFlags = { - verbose => 'undef', - nodaemon => 'undef', - sql_connection => 'mysql://root:@127.0.0.1/nova', - network_manager => 'nova.network.manager.FlatManager', - image_service => 'nova.image.glance.GlanceImageService', - flat_network_bridge => 'xenbr0', - connection_type => 'xenapi', - xenapi_connection_url => 'https://', - xenapi_connection_username => 'root', - xenapi_connection_password => 'password', - xenapi_inject_image => 'false', - rescue_timeout => '86400', - allow_admin_api => 'true', - xenapi_inject_image => 'false', - use_ipv6 => 'false', - flat_injected => 'true', - ipv6_backend => 'account_identifier', - } - class { "nova": novaConfHash => $novaConfFlags } - class { "nova::api": isServiceEnabled => false } +class { "nova": + } -include nova-api-test +class { "nova::api": enabled => false } diff --git a/nova/tests/compute.pp b/nova/tests/compute.pp index 3d67a920c..b10426bb5 100644 --- a/nova/tests/compute.pp +++ b/nova/tests/compute.pp @@ -1,32 +1,7 @@ -#include nova::compute -class nova-compute-test { - $novaConfFlags = { - verbose => 'undef', - nodaemon => 'undef', - sql_connection => 'mysql://root:@127.0.0.1/nova', - network_manager => 'nova.network.manager.FlatManager', - image_service => 'nova.image.glance.GlanceImageService', - flat_network_bridge => 'xenbr0', - connection_type => 'xenapi', - xenapi_connection_url => 'https://', - xenapi_connection_username => 'root', - xenapi_connection_password => 'password', - xenapi_inject_image => 'false', - rescue_timeout => '86400', - allow_admin_api => 'true', - xenapi_inject_image => 'false', - use_ipv6 => 'true', - flat_injected => 'true', - ipv6_backend => 'account_identifier', - } - class { "nova": novaConfHash => $novaConfFlags } - class { "nova::compute": isServiceEnabled => false } -} -include nova-compute-test - - class { 'nova::compute': } -class { 'nova': } +class { 'nova': + +} diff --git a/nova/tests/network.pp b/nova/tests/network.pp index 924a3a3ab..74b4f652e 100644 --- a/nova/tests/network.pp +++ b/nova/tests/network.pp @@ -1,24 +1,6 @@ -class nova-network-test { - $novaConfFlags = { - verbose => 'undef', - nodaemon => 'undef', - sql_connection => 'mysql://root:@127.0.0.1/nova', - network_manager => 'nova.network.manager.FlatManager', - image_service => 'nova.image.glance.GlanceImageService', - flat_network_bridge => 'xenbr0', - connection_type => 'xenapi', - xenapi_connection_url => 'https://', - xenapi_connection_username => 'root', - xenapi_connection_password => 'password', - xenapi_inject_image => 'false', - rescue_timeout => '86400', - allow_admin_api => 'true', - xenapi_inject_image => 'false', - use_ipv6 => 'true', - flat_injected => 'true', - ipv6_backend => 'account_identifier', - } - class { "nova": novaConfHash => $novaConfFlags } - class { "nova::network": isServiceEnabled => false } +class { "nova": + +} +class { "nova::network": + enabled => false } -include nova-network-test diff --git a/nova/tests/objectstore.pp b/nova/tests/objectstore.pp index 079b3150d..1aca6917b 100644 --- a/nova/tests/objectstore.pp +++ b/nova/tests/objectstore.pp @@ -1,24 +1,6 @@ -class nova-objectstore-test { - $novaConfFlags = { - verbose => 'undef', - nodaemon => 'undef', - sql_connection => 'mysql://root:@127.0.0.1/nova', - network_manager => 'nova.network.manager.FlatManager', - image_service => 'nova.image.glance.GlanceImageService', - flat_network_bridge => 'xenbr0', - connection_type => 'xenapi', - xenapi_connection_url => 'https://', - xenapi_connection_username => 'root', - xenapi_connection_password => 'password', - xenapi_inject_image => 'false', - rescue_timeout => '86400', - allow_admin_api => 'true', - xenapi_inject_image => 'false', - use_ipv6 => 'true', - flat_injected => 'true', - ipv6_backend => 'account_identifier', - } - class { "nova": novaConfHash => $novaConfFlags } - class { "nova::objectstore": isServiceEnabled => false } +class { "nova": + +} +class { "nova::objectstore": + enabled => false } -include nova-objectstore-test diff --git a/nova/tests/scheduler.pp b/nova/tests/scheduler.pp index 32cdb9654..98663fe09 100644 --- a/nova/tests/scheduler.pp +++ b/nova/tests/scheduler.pp @@ -1,24 +1,6 @@ -class nova-scheduler-test { - $novaConfFlags = { - verbose => 'undef', - nodaemon => 'undef', - sql_connection => 'mysql://root:@127.0.0.1/nova', - network_manager => 'nova.network.manager.FlatManager', - image_service => 'nova.image.glance.GlanceImageService', - flat_network_bridge => 'xenbr0', - connection_type => 'xenapi', - xenapi_connection_url => 'https://', - xenapi_connection_username => 'root', - xenapi_connection_password => 'password', - xenapi_inject_image => 'false', - rescue_timeout => '86400', - allow_admin_api => 'true', - xenapi_inject_image => 'false', - use_ipv6 => 'true', - flat_injected => 'true', - ipv6_backend => 'account_identifier', - } - class { "nova": novaConfHash => $novaConfFlags } - class { "nova::scheduler": isServiceEnabled => false } +class { "nova": + +} +class { "nova::scheduler": + enabled => false } -include nova-scheduler-test