initial commit

This commit is contained in:
Dan Bode
2012-10-09 00:51:20 -07:00
parent 2f1b72c979
commit 0a4991394d
6 changed files with 195 additions and 131 deletions

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
modules
Puppetfile.lock
.librarian/
.vagrant
.tmp

View File

@@ -1,12 +1,12 @@
forge "http://forge.puppetlabs.com" forge "http://forge.puppetlabs.com"
mod 'bodepd/devstack', :git => 'git://github.com/bodepd/puppetlabs-devstack' mod 'puppetlabs/openstack', :git => 'git://github.com/bodepd/puppetlabs-openstack', :ref => 'folsom'
mod 'puppetlabs/openstack', :git => 'git://github.com/puppetlabs/puppetlabs-openstack' mod 'puppetlabs/nova', :git => 'git://github.com/bodepd/puppetlabs-nova', :ref => 'folsom'
mod 'puppetlabs/nova', :git => 'git://github.com/puppetlabs/puppetlabs-nova' mod 'puppetlabs/glance', :git => 'git://github.com/bodepd/puppetlabs-glance', :ref => 'folsom'
mod 'puppetlabs/glance', :git => 'git://github.com/puppetlabs/puppetlabs-glance' mod 'puppetlabs/keystone', :git => 'git://github.com/bodepd/puppetlabs-keystone', :ref => 'folsom'
mod 'puppetlabs/horizon', :git => 'git://github.com/bodepd/puppetlabs-horizon', :ref => 'folsom'
mod 'puppetlabs/swift', :git => 'git://github.com/puppetlabs/puppetlabs-swift' mod 'puppetlabs/swift', :git => 'git://github.com/puppetlabs/puppetlabs-swift'
mod 'puppetlabs/keystone', :git => 'git://github.com/puppetlabs/puppetlabs-keystone' mod 'bodepd/devstack', :git => 'git://github.com/bodepd/puppetlabs-devstac'k
mod 'puppetlabs/horizon', :git => 'git://github.com/puppetlabs/puppetlabs-horizon'
# openstack middleware # openstack middleware
mod 'puppetlabs/rabbitmq', :git => 'git://github.com/puppetlabs/puppetlabs-rabbitmq' mod 'puppetlabs/rabbitmq', :git => 'git://github.com/puppetlabs/puppetlabs-rabbitmq'
mod 'puppetlabs/mysql', :git => 'git://github.com/puppetlabs/puppetlabs-mysql' mod 'puppetlabs/mysql', :git => 'git://github.com/puppetlabs/puppetlabs-mysql'

31
README Normal file
View File

@@ -0,0 +1,31 @@
This is a puppet project used to develop on the openstack modules.
It is currently being used to add folsom support.
All of the dependent modules can be installed by invoking
> librarian-puppet install
Too see a list of the virtual machines that are managed by vagrant, run
> vagrant status
The machines should be deployed in the following order:
1. mysql
2. keystone
3. glance
4. nova_controller
5. compute1
current status:
mysql, keystone, glance currently work
nova_controller partially works (vnc does not work)
nova_network does not work
cinder and quantum are not supported yet
openstack::controller and openstack::all have not been tested yet.

46
Vagrantfile vendored
View File

@@ -15,7 +15,25 @@ Vagrant::Config.run do |config|
{'devstack' => {'devstack' =>
{ {
'memory' => 512, 'memory' => 512,
'ip1' => '172.16.0.6', 'ip1' => '172.16.0.2',
}
},
{'compute1' =>
{
'memory' => 2512,
'ip1' => '172.16.0.4'
}
},
{'nova_controller' =>
{
'memory' => 512,
'ip1' => '172.16.0.5'
}
},
{'glance' =>
{
'memory' => 512,
'ip1' => '172.16.0.6'
} }
}, },
{'keystone' => {'keystone' =>
@@ -29,21 +47,20 @@ Vagrant::Config.run do |config|
'memory' => 512, 'memory' => 512,
'ip1' => '172.16.0.8' 'ip1' => '172.16.0.8'
} }
}, #},
{'controller' => #{'controller' =>
{'memory' => 512, # {'memory' => 512,
'ip1' => '172.16.0.3' # 'ip1' => '172.16.0.3'
} # }
}, #},
{'compute_1' => #{'compute_1' =>
{'ip1' => '172.16.0.4'} # {'ip1' => '172.16.0.4'}
}, #},
{'compute_2' => #{'compute_2' =>
{'ip1' => '172.16.0.5'} # {'ip1' => '172.16.0.5'}
} }
].each do |hash| ].each do |hash|
ssh_forward_port = ssh_forward_port + 1
name = hash.keys.first name = hash.keys.first
props = hash.values.first props = hash.values.first
@@ -51,7 +68,8 @@ Vagrant::Config.run do |config|
raise "Malformed vhost hash" if hash.size > 1 raise "Malformed vhost hash" if hash.size > 1
config.vm.define name.intern do |agent| config.vm.define name.intern do |agent|
ssh_forward_port = ssh_forward_port + 1
agent.vm.forward_port(22, ssh_forward_port)
# host only network # host only network
agent.vm.network :hostonly, props['ip1'], :adapter => 2 agent.vm.network :hostonly, props['ip1'], :adapter => 2
#agent.vm.customize ["modifyvm", :id, "--nicpromisc1", "allow-all"] #agent.vm.customize ["modifyvm", :id, "--nicpromisc1", "allow-all"]

View File

@@ -25,8 +25,13 @@ exec { '/usr/bin/apt-get update':
# #
# specify a connection to the hardcoded puppet master # specify a connection to the hardcoded puppet master
# #
host { 'puppet': host {
ip => '172.16.0.2', 'puppet': ip => '172.16.0.2';
'glance': ip => '172.16.0.6';
'keystone': ip => '172.16.0.7';
'mysql': ip => '172.16.0.8';
'novacontroller': ip => '172.16.0.5';
'compute1': ip => '172.16.0.4';
} }
group { 'puppet': group { 'puppet':
@@ -36,3 +41,4 @@ group { 'puppet':
# bring up the bridging interface explicitly # bring up the bridging interface explicitly
#exec { '/sbin/ifconfig eth2 up': } #exec { '/sbin/ifconfig eth2 up': }
node default { }

View File

@@ -11,31 +11,6 @@
# be used in the deployment of multi and single node openstack # be used in the deployment of multi and single node openstack
# environments # environments
# assumes that eth0 is the public interface
$public_interface = 'eth0'
# assumes that eth1 is the interface that will be used for the vm network
# this configuration assumes this interface is active but does not have an
# ip address allocated to it.
$private_interface = 'eth2'
# credentials
$admin_email = 'root@localhost'
$admin_password = 'keystone_admin'
$keystone_db_password = 'keystone_db_pass'
$keystone_admin_token = 'keystone_admin_token'
$nova_db_password = 'nova_pass'
$nova_user_password = 'nova_pass'
$glance_db_password = 'glance_pass'
$glance_user_password = 'glance_pass'
$rabbit_password = 'openstack_rabbit_password'
$rabbit_user = 'openstack_rabbit_user'
$fixed_network_range = '10.0.0.0/24'
$floating_network_range = '172.16.0.192/26'
# switch this to true to have all service log at verbose
$verbose = false
# by default it does not enable atomatically adding floating IPs
$auto_assign_floating_ip = false
#### end shared variables ################# #### end shared variables #################
# all nodes whose certname matches openstack_all should be # all nodes whose certname matches openstack_all should be
@@ -46,24 +21,24 @@ node /openstack-all/ {
class { 'openstack::test_file': } class { 'openstack::test_file': }
class { 'openstack::all': class { 'openstack::all':
public_address => $ipaddress_eth1, # public_address => $ipaddress_eth1,
public_interface => $public_interface, # public_interface => $public_interface,
private_interface => $private_interface, # private_interface => $private_interface,
admin_email => $admin_email, # admin_email => $admin_email,
admin_password => $admin_password, # admin_password => $admin_password,
keystone_db_password => $keystone_db_password, # keystone_db_password => $keystone_db_password,
keystone_admin_token => $keystone_admin_token, # keystone_admin_token => $keystone_admin_token,
nova_db_password => $nova_db_password, # nova_db_password => $nova_db_password,
nova_user_password => $nova_user_password, # nova_user_password => $nova_user_password,
glance_db_password => $glance_db_password, # glance_db_password => $glance_db_password,
glance_user_password => $glance_user_password, # glance_user_password => $glance_user_password,
rabbit_password => $rabbit_password, # rabbit_password => $rabbit_password,
rabbit_user => $rabbit_user, # rabbit_user => $rabbit_user,
libvirt_type => 'qemu', # libvirt_type => 'qemu',
floating_range => $floating_network_range, # floating_range => $floating_network_range,
fixed_range => $fixed_network_range, # fixed_range => $fixed_network_range,
verbose => $verbose, # verbose => $verbose,
auto_assign_floating_ip => $auto_assign_floating_ip, # auto_assign_floating_ip => $auto_assign_floating_ip,
} }
class { 'openstack::auth_file': class { 'openstack::auth_file':
@@ -81,103 +56,128 @@ node /mysql/ {
keystone_db_password => 'keystone_password', keystone_db_password => 'keystone_password',
glance_db_password => 'glance_password', glance_db_password => 'glance_password',
nova_db_password => 'nova_password', nova_db_password => 'nova_password',
allowed_hosts => ['keystone', 'glance', 'novacontroller', 'compute1', '%'],
} }
} }
node /keystone/ { node /keystone/ {
class { 'keystone': nova_config {
log_verbose => true, 'DEFAULT/log_config': ensure => absent,
log_debug => true, }
sql_connection => 'mysql://keystone_admin:password@172.16.0.8/keystone',
catalog_type => 'sql', class { 'openstack::keystone':
db_host => '172.16.0.8',
db_password => 'keystone_password',
admin_token => 'service_token',
admin_email => 'keystone@localhost',
admin_password => 'ChangeMe',
glance_user_password => 'glance_password',
nova_user_password => 'nova_password',
public_address => '172.16.0.7',
admin_tenant => 'admin',
glance_public_address => '172.16.0.6',
nova_public_address => '172.16.0.5',
verbose => 'true',
} }
class { 'keystone::roles::admin': }
} }
node /controller/ { node /glance/ {
# deploy a script that can be used to test nova class { 'openstack::glance':
class { 'openstack::test_file': } db_host => '172.16.0.8',
glance_user_password => 'glance_password',
$controller_node_address = $ipaddress_eth1 glance_db_password => 'glance_password',
$controller_node_public = $controller_node_address keystone_host => '172.16.0.7',
$controller_node_internal = $controller_node_address auth_uri => "http://172.16.0.7:5000/",
verbose => true,
# class { 'nova::volume': enabled => true }
# class { 'nova::volume::iscsi': }
class { 'openstack::controller':
public_address => $controller_node_public,
public_interface => $public_interface,
private_interface => $private_interface,
internal_address => $controller_node_internal,
floating_range => $floating_network_range,
fixed_range => $fixed_network_range,
# by default it does not enable multi-host mode
multi_host => true,
# by default is assumes flat dhcp networking mode
network_manager => 'nova.network.manager.FlatDHCPManager',
verbose => $verbose,
auto_assign_floating_ip => $auto_assign_floating_ip,
mysql_root_password => $mysql_root_password,
admin_email => $admin_email,
admin_password => $admin_password,
keystone_db_password => $keystone_db_password,
keystone_admin_token => $keystone_admin_token,
glance_db_password => $glance_db_password,
glance_user_password => $glance_user_password,
nova_db_password => $nova_db_password,
nova_user_password => $nova_user_password,
rabbit_password => $rabbit_password,
rabbit_user => $rabbit_user,
export_resources => false,
} }
class { 'openstack::auth_file': class { 'openstack::auth_file':
admin_password => $admin_password, admin_password => 'ChangeMe',
keystone_admin_token => $keystone_admin_token, keystone_admin_token => 'service_token',
controller_node => $controller_node_internal, controller_node => '172.16.0.7',
admin_tenant => 'admin',
}
}
node /nova-controller/ {
# deploy a script that can be used to test nova
class { 'openstack::test_file': }
# class { 'nova::volume': enabled => true }
# class { 'nova::volume::iscsi': }
class { 'openstack::nova::controller':
public_address => '172.16.0.5',
public_interface => 'eth0',
private_interface => 'eth1',
db_host => '172.16.0.8',
rabbit_password => 'changeme',
nova_user_password => 'nova_password',
nova_db_password => 'nova_password',
network_manager => 'nova.network.manager.FlatDHCPManager',
verbose => 'True',
multi_host => true,
glance_api_servers => '172.16.0.6:9292',
keystone_host => '172.16.0.7',
#floating_range => $floating_network_range,
#fixed_range => $fixed_network_range,
} }
class { 'openstack::horizon':
secret_key => 'dummy_secret_key',
cache_server_ip => '127.0.0.1',
cache_server_port => '11211',
swift => false,
quantum => false,
horizon_app_links => undef,
keystone_host => '172.16.0.7',
keystone_default_role => 'Member',
}
class { 'openstack::auth_file':
admin_password => 'ChangeMe',
keystone_admin_token => 'service_token',
controller_node => '172.16.0.7',
admin_tenant => 'admin',
}
} }
node /compute/ { node /compute/ {
# deploy a script that can be used to test nova # deploy a script that can be used to test nova
class { 'openstack::test_file': } class { 'openstack::test_file': }
# External lookups. # External lookups.
$rabbit_connection_hash = collect_rabbit_connection('ipaddress_eth1', 'architecture=amd64') # $rabbit_connection_hash = collect_rabbit_connection('ipaddress_eth1', 'architecture=amd64')
$nova_db_addr = collect_nova_db_connection('ipaddress_eth1', 'architecture=amd64') # $nova_db_addr = collect_nova_db_connection('ipaddress_eth1', 'architecture=amd64')
$vnc_proxy_addr = unique(query_nodes('Class[nova::vncproxy]', 'ipaddress_eth1')) # $vnc_proxy_addr = unique(query_nodes('Class[nova::vncproxy]', 'ipaddress_eth1'))
$glance_api_addr = unique(query_nodes('Class[glance::api]', 'ipaddress_eth1')) # $glance_api_addr = unique(query_nodes('Class[glance::api]', 'ipaddress_eth1'))
class { 'openstack::compute': class { 'openstack::compute':
public_interface => $public_interface, public_interface => 'eth1',
private_interface => $private_interface, private_interface => 'eth0',
internal_address => $ipaddress_eth1, internal_address => $::ipaddress_eth1,
libvirt_type => 'qemu', libvirt_type => 'qemu',
fixed_range => $fixed_network_range, sql_connection => 'mysql://nova:nova_password@172.16.0.8/nova',
fixed_range => '10.0.0.0/24',
network_manager => 'nova.network.manager.FlatDHCPManager', network_manager => 'nova.network.manager.FlatDHCPManager',
multi_host => true, multi_host => true,
sql_connection => $nova_db_addr, nova_user_password => 'nova_password',
nova_user_password => $nova_user_password, rabbit_host => '172.16.0.5',
rabbit_host => $rabbit_connection_hash['host'], rabbit_password => 'changeme',
rabbit_password => $rabbit_password, glance_api_servers => ["172.16.0.6:9292"],
rabbit_user => $rabbit_user, vncproxy_host => '172.16.0.5',
glance_api_servers => ["${glance_api_addr}:9292"],
vncproxy_host => $vnc_proxy_addr,
vnc_enabled => true, vnc_enabled => true,
verbose => $verbose, verbose => true,
manage_volumes => true, manage_volumes => true,
nova_volume => 'nova-volumes' nova_volume => 'nova-volumes'
} }
} }
node /devstack/ { node /devstack/ {
@@ -280,3 +280,7 @@ node /master/ {
tag => ['pe'] tag => ['pe']
} }
} }
node default {
notify { $clientcert: }
}