committed the code that was moved from openstack
- also added nova::db
This commit is contained in:
parent
a441a5387e
commit
845ba25967
|
@ -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
|
|
@ -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 }
|
||||
}
|
|
@ -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"]
|
||||
}
|
||||
}
|
|
@ -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"]
|
||||
}
|
||||
}
|
|
@ -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']
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
class nova {
|
||||
class nova( $novaConfHash ) {
|
||||
|
||||
class { 'puppet': }
|
||||
class {
|
||||
[
|
||||
|
@ -10,11 +11,16 @@ class nova {
|
|||
'python',
|
||||
]:
|
||||
}
|
||||
class { 'mysql::server':
|
||||
mysql_root_pw => 'password',
|
||||
package { "python-greenlet": ensure => present }
|
||||
|
||||
package { ["nova-common", "nova-doc"]:
|
||||
ensure => present,
|
||||
require => Package["python-greenlet"]
|
||||
}
|
||||
|
||||
file { "/etc/nova/nova.conf":
|
||||
ensure => present,
|
||||
content => template("nova/nova.conf.erb"),
|
||||
require => Package["nova-common"]
|
||||
}
|
||||
#mysql::db { ['nova', 'glance']:}
|
||||
#class rabbitmq::server {
|
||||
#
|
||||
# }
|
||||
}
|
||||
|
|
|
@ -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"]
|
||||
}
|
||||
}
|
|
@ -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"]
|
||||
}
|
||||
}
|
|
@ -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',
|
||||
|
|
|
@ -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"]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<% novaConfHash.each do |key, value| -%>
|
||||
<% if value != "undef" -%>
|
||||
--<%= key -%>=<%= value %>
|
||||
<% else -%>
|
||||
--<%= key %>
|
||||
<% end -%>
|
||||
<% end -%>
|
|
@ -1,7 +0,0 @@
|
|||
stage { 'repo-setup':
|
||||
before => Stage['main'],
|
||||
}
|
||||
class { ['apt', 'nova::repo']:
|
||||
stage => 'repo-setup',
|
||||
}
|
||||
class { 'nova': }
|
|
@ -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=''
|
||||
) {
|
||||
}
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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…
Reference in New Issue