Browse Source

committed the code that was moved from openstack

- also added nova::db
changes/27/26227/1
Dan Bode 10 years ago
parent
commit
845ba25967
  1. 4
      nova/README
  2. 46
      nova/manifests/all.pp
  3. 11
      nova/manifests/api.pp
  4. 13
      nova/manifests/compute.pp
  5. 15
      nova/manifests/db.pp
  6. 20
      nova/manifests/init.pp
  7. 12
      nova/manifests/network.pp
  8. 12
      nova/manifests/objectstore.pp
  9. 2
      nova/manifests/repo.pp
  10. 12
      nova/manifests/scheduler.pp
  11. 7
      nova/templates/nova.conf.erb
  12. 7
      nova/tests/init.pp
  13. 44
      nova/tests/openstack-all.pp
  14. 24
      nova/tests/openstack-api.pp
  15. 25
      nova/tests/openstack-compute.pp
  16. 24
      nova/tests/openstack-network.pp
  17. 24
      nova/tests/openstack-objectstore.pp
  18. 24
      nova/tests/openstack-scheduler.pp

4
nova/README

@ -0,0 +1,4 @@
h1. Prerequisites
The openstack repo should be made available:
see: http://docs.openstack.org/cactus/openstack-compute/admin/content/installing-the-cloud-controller.html

46
nova/manifests/all.pp

@ -0,0 +1,46 @@
class nova::all(
$xenapi_connection_url,
$xenapi_connection_username,
$xenapi_connection_password,
$sql_connection,
$network_manager,
$image_service,
$verbose = 'undef',
$nodaemon = 'undef',
$flat_network_bridge = 'xenbr0',
$connection_type = 'xenapi',
$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'
) {
$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 }
}

11
nova/manifests/api.pp

@ -0,0 +1,11 @@
class nova::api($isServiceEnabled=false) inherits nova {
package { "nova-api":
ensure => present,
require => Package["python-greenlet"]
}
service { "nova-api":
ensure => $isServiceEnabled,
require => Package["nova-api"],
subscribe => File["/etc/nova/nova.conf"]
}
}

13
nova/manifests/compute.pp

@ -0,0 +1,13 @@
class nova::compute( $isServiceEnabled=false ) inherits nova {
package { "nova-compute":
ensure => present,
require => Package["python-greenlet"]
}
service { "nova-compute":
ensure => $isServiceEnabled,
require => Package["nova-compute"],
subscribe => File["/etc/nova/nova.conf"]
}
}

15
nova/manifests/db.pp

@ -0,0 +1,15 @@
class nova::db(
$db_pw,
$db_user = 'nova'
$db_name = 'nova',
$db_host => 'localhost'
) {
mysql::db { $db_name:
db_user => $db_user,
db_pw => $db_pw,
db_hostname => $db_hostname,
# I may want to inject some sql
# sql='',
require => Class['mysql::server']
}
}

20
nova/manifests/init.pp

@ -1,4 +1,5 @@
class nova {
class nova( $novaConfHash ) {
class { 'puppet': }
class {
[
@ -9,12 +10,17 @@ class nova {
# I may need to move python-mysqldb to elsewhere if it depends on mysql
'python',
]:
}
package { "python-greenlet": ensure => present }
package { ["nova-common", "nova-doc"]:
ensure => present,
require => Package["python-greenlet"]
}
class { 'mysql::server':
mysql_root_pw => 'password',
file { "/etc/nova/nova.conf":
ensure => present,
content => template("nova/nova.conf.erb"),
require => Package["nova-common"]
}
#mysql::db { ['nova', 'glance']:}
#class rabbitmq::server {
#
# }
}

12
nova/manifests/network.pp

@ -0,0 +1,12 @@
class nova::network( $isServiceEnabled=false ) inherits nova {
package { "nova-network":
ensure => present,
require => Package["python-greenlet"]
}
service { "nova-network":
ensure => $isServiceEnabled,
require => Package["nova-network"],
subscribe => File["/etc/nova/nova.conf"]
}
}

12
nova/manifests/objectstore.pp

@ -0,0 +1,12 @@
class nova::objectstore( $isServiceEnabled=false ) inherits nova {
package { "nova-objectstore":
ensure => present,
require => Package["python-greenlet"]
}
service { "nova-objectstore":
ensure => $isServiceEnabled,
require => Package["nova-objectstore"],
subscribe => File["/etc/nova/nova.conf"]
}
}

2
nova/manifests/repo.pp

@ -1,4 +1,6 @@
class nova::repo {
# this should not be hard-coded
# eventually this will be on a real debian repo
apt::source { 'openstack':
location => 'http://jenkins.ohthree.com',
release => 'unstable',

12
nova/manifests/scheduler.pp

@ -0,0 +1,12 @@
class nova::scheduler( $isServiceEnabled ) inherits nova {
package { "nova-scheduler":
ensure => present,
require => Package["python-greenlet"]
}
service { "nova-scheduler":
ensure => $isServiceEnabled,
require => Package["nova-scheduler"],
subscribe => File["/etc/nova/nova.conf"]
}
}

7
nova/templates/nova.conf.erb

@ -0,0 +1,7 @@
<% novaConfHash.each do |key, value| -%>
<% if value != "undef" -%>
--<%= key -%>=<%= value %>
<% else -%>
--<%= key %>
<% end -%>
<% end -%>

7
nova/tests/init.pp

@ -1,7 +0,0 @@
stage { 'repo-setup':
before => Stage['main'],
}
class { ['apt', 'nova::repo']:
stage => 'repo-setup',
}
class { 'nova': }

44
nova/tests/openstack-all.pp

@ -0,0 +1,44 @@
stage { 'repo-setup':
before => Stage['main'],
}
class { 'apt':
disable_keys => true,
always_apt_update => true,
stage => 'repo-setup',
}
class { 'nova::repo':
stage => 'repo-setup',
}
class { 'nova::all':
verbose => 'undef',
nodaemon => 'undef',
sql_connection => 'mysql://root:<password>@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://<XenServer IP>',
xenapi_connection_username => 'root',
xenapi_connection_password => 'password',
xenapi_inject_image => 'false',
rescue_timeout => '86400',
allow_admin_api => 'true',
use_ipv6 => 'false',
flat_injected => 'true',
ipv6_backend => 'account_identifier',
}
# this will probably be on its own machine
class mysql::server {
mysql_root_pw => 'foo',
}
mysql::db {
db_user,
db_pw,
db_charset = 'utf8',
host = 'localhost',
grant='all',
sql=''
) {
}

24
nova/tests/openstack-api.pp

@ -0,0 +1,24 @@
class nova-api-test {
$novaConfFlags = {
verbose => 'undef',
nodaemon => 'undef',
sql_connection => 'mysql://root:<password>@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://<XenServer IP>',
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 }
}
include nova-api-test

25
nova/tests/openstack-compute.pp

@ -0,0 +1,25 @@
#include nova::compute
class nova-compute-test {
$novaConfFlags = {
verbose => 'undef',
nodaemon => 'undef',
sql_connection => 'mysql://root:<password>@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://<XenServer IP>',
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

24
nova/tests/openstack-network.pp

@ -0,0 +1,24 @@
class nova-network-test {
$novaConfFlags = {
verbose => 'undef',
nodaemon => 'undef',
sql_connection => 'mysql://root:<password>@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://<XenServer IP>',
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 }
}
include nova-network-test

24
nova/tests/openstack-objectstore.pp

@ -0,0 +1,24 @@
class nova-objectstore-test {
$novaConfFlags = {
verbose => 'undef',
nodaemon => 'undef',
sql_connection => 'mysql://root:<password>@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://<XenServer IP>',
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 }
}
include nova-objectstore-test

24
nova/tests/openstack-scheduler.pp

@ -0,0 +1,24 @@
class nova-scheduler-test {
$novaConfFlags = {
verbose => 'undef',
nodaemon => 'undef',
sql_connection => 'mysql://root:<password>@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://<XenServer IP>',
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 }
}
include nova-scheduler-test
Loading…
Cancel
Save