commit
4e76473925
|
@ -1 +1,2 @@
|
|||
*.swp
|
||||
spec/fixtures/modules/*
|
||||
|
|
|
@ -0,0 +1,173 @@
|
|||
$rabbit_password = 'rabbit_pw'
|
||||
$rabbit_user = 'nova'
|
||||
|
||||
$glance_api_servers = '127.0.0.1:9292'
|
||||
|
||||
$mysql_root_password = 'sql_pass'
|
||||
$keystone_db_password = 'keystone_pass'
|
||||
$keystone_admin_token = 'keystone_admin_token'
|
||||
|
||||
$admin_email = 'dan@puppetlabs.com'
|
||||
$admin_user_password = 'admin_password'
|
||||
|
||||
$nova_db_password = 'nova_pass'
|
||||
$nova_user_password = 'nova_pass'
|
||||
|
||||
$glance_db_password = 'glance_pass'
|
||||
$glance_user_password = 'glance_pass'
|
||||
|
||||
#
|
||||
# indicates that all nova config entries that we did
|
||||
# not specifify in Puppet should be purged from file
|
||||
#
|
||||
resources { 'nova_config':
|
||||
purge => true,
|
||||
}
|
||||
|
||||
# temporarily update this to use the
|
||||
# latest tested packages from precise
|
||||
# eventually, these packages need to be moved
|
||||
# to the openstack module
|
||||
stage { 'nova_ppa':
|
||||
before => Stage['main']
|
||||
}
|
||||
|
||||
class { 'apt':
|
||||
stage => 'nova_ppa',
|
||||
}
|
||||
class { 'keystone::repo::trunk':
|
||||
stage => 'nova_ppa',
|
||||
}
|
||||
|
||||
# this is a hack that I have to do b/c openstack nova
|
||||
# sets up a route to reroute calls to the metadata server
|
||||
# to its own server which fails
|
||||
file { '/usr/lib/ruby/1.8/facter/ec2.rb':
|
||||
ensure => absent,
|
||||
}
|
||||
|
||||
# set up mysql server
|
||||
class { 'mysql::server':
|
||||
config_hash => {
|
||||
# the priv grant fails on precise if I set a root password
|
||||
# 'root_password' => $mysql_root_password,
|
||||
'bind_address' => '127.0.0.1'
|
||||
}
|
||||
}
|
||||
|
||||
####### KEYSTONE ###########
|
||||
|
||||
# set up keystone database
|
||||
class { 'keystone::mysql':
|
||||
password => $keystone_db_password,
|
||||
}
|
||||
# set up the keystone config for mysql
|
||||
class { 'keystone::config::mysql':
|
||||
password => $keystone_db_password,
|
||||
}
|
||||
# set up keystone
|
||||
class { 'keystone':
|
||||
admin_token => $keystone_admin_token,
|
||||
bind_host => '127.0.0.1',
|
||||
log_verbose => true,
|
||||
log_debug => true,
|
||||
catalog_type => 'sql',
|
||||
}
|
||||
# set up keystone admin users
|
||||
class { 'keystone::roles::admin':
|
||||
email => $admin_email,
|
||||
password => $admin_user_password,
|
||||
}
|
||||
# set up the keystone service and endpoint
|
||||
class { 'keystone::endpoint': }
|
||||
|
||||
######## END KEYSTONE ##########
|
||||
|
||||
######## BEGIN GLANCE ##########
|
||||
|
||||
class { 'glance::keystone::auth':
|
||||
password => $glance_user_password,
|
||||
}
|
||||
|
||||
class { 'glance::db':
|
||||
host => '127.0.0.1',
|
||||
password => $glance_db_password,
|
||||
}
|
||||
|
||||
class { 'glance::api':
|
||||
log_verbose => 'True',
|
||||
log_debug => 'True',
|
||||
auth_type => 'keystone',
|
||||
auth_host => '127.0.0.1',
|
||||
auth_port => '35357',
|
||||
keystone_tenant => 'services',
|
||||
keystone_user => 'glance',
|
||||
keystone_password => $glance_user_password,
|
||||
}
|
||||
class { 'glance::backend::file': }
|
||||
|
||||
class { 'glance::registry':
|
||||
log_verbose => 'True',
|
||||
log_debug => 'True',
|
||||
auth_type => 'keystone',
|
||||
auth_host => '127.0.0.1',
|
||||
auth_port => '35357',
|
||||
keystone_tenant => 'services',
|
||||
keystone_user => 'glance',
|
||||
keystone_password => $glance_user_password,
|
||||
sql_connection => "mysql://glance:${glance_db_password}@127.0.0.1/glance",
|
||||
}
|
||||
|
||||
|
||||
######## END GLANCE ###########
|
||||
|
||||
######## BEGIN NOVA ###########
|
||||
|
||||
class { 'nova::keystone::auth':
|
||||
password => $nova_user_password,
|
||||
}
|
||||
|
||||
class { 'nova::rabbitmq':
|
||||
userid => $rabbit_user,
|
||||
password => $rabbit_password,
|
||||
}
|
||||
|
||||
class { 'nova::db':
|
||||
password => $nova_db_password,
|
||||
host => 'localhost',
|
||||
}
|
||||
|
||||
class { 'nova':
|
||||
sql_connection => "mysql://nova:${nova_db_password}@localhost/nova",
|
||||
rabbit_userid => $rabbit_user,
|
||||
rabbit_password => $rabbit_password,
|
||||
image_service => 'nova.image.glance.GlanceImageService',
|
||||
glance_api_servers => '127.0.0.1:9292',
|
||||
network_manager => 'nova.network.manager.FlatDHCPManager',
|
||||
admin_password => $nova_user_password,
|
||||
}
|
||||
|
||||
class { 'nova::api':
|
||||
enabled => true
|
||||
}
|
||||
|
||||
class { 'nova::scheduler':
|
||||
enabled => true
|
||||
}
|
||||
|
||||
class { 'nova::network':
|
||||
enabled => true
|
||||
}
|
||||
|
||||
class { 'nova::objectstore':
|
||||
enabled => true
|
||||
}
|
||||
|
||||
class { 'nova::compute':
|
||||
enabled => true,
|
||||
}
|
||||
|
||||
class { 'nova::compute::libvirt':
|
||||
flat_network_bridge_ip => '192.168.188.1',
|
||||
flat_network_bridge_netmask => '255.255.255.0',
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
#schedulee this class should probably never be declared except
|
||||
# from the virtualization implementation of the compute node
|
||||
class nova::compute(
|
||||
$enabled = false,
|
||||
$enabled = false
|
||||
) inherits nova {
|
||||
|
||||
nova::generic_service { 'compute':
|
||||
|
|
|
@ -7,6 +7,7 @@ class nova::db(
|
|||
$cluster_id = 'localzone'
|
||||
) {
|
||||
|
||||
require 'mysql::python'
|
||||
# Create the db instance before openstack-nova if its installed
|
||||
Mysql::Db[$dbname] -> Anchor<| title == "nova-start" |>
|
||||
Mysql::Db[$dbname] ~> Exec<| title == 'initial-db-sync' |>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
define nova::generic_service(
|
||||
$package_name,
|
||||
$service_name,
|
||||
$enabled = false,
|
||||
$enabled = false
|
||||
) {
|
||||
|
||||
include nova::params
|
||||
|
|
|
@ -31,7 +31,7 @@ class nova(
|
|||
$auth_uri = 'http://127.0.0.1:5000/v2.0',
|
||||
$admin_tenant_name = 'services',
|
||||
$admin_user = 'nova',
|
||||
$admin_password = 'passw0rd',
|
||||
$admin_password = 'passw0rd'
|
||||
) inherits nova::params {
|
||||
|
||||
# all nova_config resources should be applied
|
||||
|
|
|
@ -18,7 +18,7 @@ class nova::keystone::auth(
|
|||
require => Keystone_user[$auth_name]
|
||||
}
|
||||
keystone_service { $auth_name:
|
||||
type => 'image',
|
||||
type => 'compute',
|
||||
description => "Openstack Compute Service",
|
||||
}
|
||||
keystone_endpoint { $auth_name:
|
||||
|
@ -26,7 +26,6 @@ class nova::keystone::auth(
|
|||
public_url => "http://${address}:${port}/${version}/%(tenant_id)s",
|
||||
admin_url => "http://${address}:${port}/${version}/%(tenant_id)s",
|
||||
internal_url => "http://${address}:${port}/${version}/%(tenant_id)s",
|
||||
require => Keystone_service[$auth_name],
|
||||
}
|
||||
|
||||
}
|
|
@ -23,7 +23,7 @@ describe 'nova::api' do
|
|||
'name' => 'nova-api',
|
||||
'ensure' => 'present',
|
||||
'notify' => 'Service[nova-api]',
|
||||
'before' => 'Exec[initial-db-sync]'
|
||||
'before' => ['Exec[initial-db-sync]', 'File[/etc/nova/api-paste.ini]']
|
||||
) }
|
||||
describe 'with enabled as true' do
|
||||
let :params do
|
||||
|
|
|
@ -76,8 +76,8 @@ describe 'nova' do
|
|||
it { should_not contain_nova_config('dhcpbridge_flagfile').with_value('/etc/nova/nova.conf') }
|
||||
it { should contain_nova_config('flat_network_bridge').with_value('br100') }
|
||||
|
||||
it { should contain_nova_config('use_deprecated_auth').with_value('true') }
|
||||
it { should contain_nova_config('root_helper').with_value('sudo') }
|
||||
it { should contain_nova_config('use_deprecated_auth').with_value('false') }
|
||||
it { should contain_nova_config('root_helper').with_value('sudo nova-rootwrap') }
|
||||
|
||||
describe 'with parameters supplied' do
|
||||
|
||||
|
@ -108,9 +108,6 @@ describe 'nova' do
|
|||
# glance config
|
||||
it { should contain_nova_config('image_service').with_value('nova.image.glance.GlanceImageService') }
|
||||
it { should contain_nova_config('glance_api_servers').with_value('localhost:9292') }
|
||||
it { should contain_nova_config('glance_host').with_value('localhost') }
|
||||
it { should contain_nova_config('glance_port').with_value('9292') }
|
||||
|
||||
it { should contain_nova_config('allow_admin_api').with_value(true) }
|
||||
it { should contain_nova_config('rabbit_host').with_value('rabbit') }
|
||||
it { should contain_nova_config('rabbit_password').with_value('password') }
|
||||
|
@ -125,7 +122,7 @@ describe 'nova' do
|
|||
it { should contain_nova_config('dhcpbridge').with_value('/usr/bin/nova-dhcpbridge') }
|
||||
it { should contain_nova_config('dhcpbridge_flagfile').with_value('/etc/nova/nova.conf') }
|
||||
|
||||
it { should contain_nova_config('use_deprecated_auth').with_value(true) }
|
||||
it { should contain_nova_config('use_deprecated_auth').with_value(false) }
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue