diff --git a/examples/site.pp b/examples/site.pp index 1cb7d98..7f806b0 100644 --- a/examples/site.pp +++ b/examples/site.pp @@ -1,25 +1,63 @@ - -# -# any nodes whose certname matches nova_all should -# become an openstack all-in-one node # +# This document serves as an example of how to deploy +# basic single and multi-node openstack environments. # -Exec { - logoutput => true, +# deploy a script that can be used to test nova +file { '/tmp/test_nova.sh': + source => 'puppet:///modules/openstack/nova_test.sh', } -resources { 'nova_config': - purge => true, -} +####### shared variables ################## + +# this section is used to specify global variables that will +# be used in the deployment of multi and single node openstack +# environments + +# assumes that eth0 is the public interface +$public_address = $ipaddress_eth0 +$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 = 'eth1' +# 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' + +#### end shared variables ################# + +# all nodes whose certname matches openstack_all should be +# deployed as all-in-one openstack installations. node /openstack_all/ { class { 'openstack::all': - public_address => $ipaddress_eth0 + public_address => $public_address, + public_interface => $public_interface, + private_interface => $private_interface, + admin_email => $admin_email, + admin_password => $admin_password, + keystone_db_password => $keystone_db_password, + keystone_admin_token => $keystone_admin_token, + nova_db_password => $nova_db_password, + nova_user_password => $nova_user_password, + glance_db_password => $glance_db_password, + glance_user_password => $glance_user_password, + libvirt_type => 'kvm', } - class { 'openstack_controller': } + class { 'openstack::auth_file': + admin_password => $admin_password, + keystone_admin_token => $keystone_admin_token, + controller_node => '127.0.0.1', + } } @@ -29,43 +67,15 @@ node /openstack_controller/ { public_address => $public_hostname, internal_address => $ipaddress, } - class { 'openstack_controller': } } node /openstack_compute/ { class { 'openstack::compute': - # setting to qemu b/c I still test in ec2 :( internal_address => $ipaddress, - libvirt_type => 'qemu', + libvirt_type => 'kvm', } } -# this shows an example of the code needed to perform -# an all in one installation - -# -# sets up a few things that I use for testing -# -class openstack_controller { - # - # set up auth credntials so that we can authenticate easily - # - file { '/root/auth': - content => - ' - export OS_TENANT_NAME=openstack - export OS_USERNAME=admin - export OS_PASSWORD=ChangeMe - export OS_AUTH_URL="http://localhost:5000/v2.0/" - ' - } - # 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, - } -} diff --git a/manifests/all.pp b/manifests/all.pp index dd70b02..2a11148 100644 --- a/manifests/all.pp +++ b/manifests/all.pp @@ -1,7 +1,52 @@ # +# == Class: openstack::all +# +# Class that performs a basic openstack all in one installation. +# +# === Parameterrs +# +# TODO public address should be optional. +# [public_address] Public address used by vnchost. Required. +# [public_interface] The interface used to route public traffic by the +# network service. +# [private_interface] The private interface used to bridge the VMs into a common network. +# [floating_range] The floating ip range to be created. If it is false, then no floating ip range is created. +# Optional. Defaults to false. +# [fixed_range] The fixed private ip range to be created for the private VM network. Optional. Defaults to '10.0.0.0/24'. +# [network_manager] The network manager to use for the nova network service. +# Optional. Defaults to 'nova.network.manager.FlatDHCPManager'. +# [network_config] Used to specify network manager specific parameters .Optional. Defualts to {}. +# [mysql_root_password] The root password to set for the mysql database. Optional. Defaults to sql_pass'. +# [rabbit_password] The password to use for the rabbitmq user. Optional. Defaults to rabbit_pw' +# [rabbit_user] The rabbitmq user to use for auth. Optional. Defaults to nova'. +# [admin_email] The admin's email address. Optional. Defaults to someuser@some_fake_email_address.foo'. +# [admin_password] The default password of the keystone admin. Optional. Defaults to ChangeMe'. +# [keystone_db_password] The default password for the keystone db user. Optional. Defaults to keystone_pass'. +# [keystone_admin_token] The default auth token for keystone. Optional. Defaults to keystone_admin_token'. +# [nova_db_password] The nova db password. Optional. Defaults to nova_pass'. +# [nova_user_password] The password of the keystone user for the nova service. Optional. Defaults to nova_pass'. +# [glance_db_password] The password for the db user for glance. Optional. Defaults to 'glance_pass'. +# [glance_user_password] The password of the glance service user. Optional. Defaults to 'glance_pass'. +# [verbose] If the services should log verbosely. Optional. Defaults to false. +# [purge_nova_config] Whether unmanaged nova.conf entries should be purged. Optional. Defaults to true. +# [libvirt_type] The virualization type being controlled by libvirt. Optional. Defaults to 'kvm'. +# [nova_volume] The name of the volume group to use for nova volume allocation. Optional. Defaults to 'nova-volumes'. +# +# === Examples +# +# class { 'openstack::all': +# public_address => '192.168.0.3', +# public_interface => eth0, +# private_interface => eth1, +# admin_email => my_email@mw.com, +# admin_password => 'my_admin_password', +# libvirt_type => 'kvm', +# } +# +# === Authors +# +# Dan Bode # -# This class can be used to perform -# an openstack all-in-one installation. # class openstack::all( # passing in the public ipaddress is required @@ -18,7 +63,7 @@ class openstack::all( $rabbit_user = 'nova', # opestack credentials $admin_email = 'someuser@some_fake_email_address.foo', - $admin_user_password = 'ChangeMe', + $admin_password = 'ChangeMe', $keystone_db_password = 'keystone_pass', $keystone_admin_token = 'keystone_admin_token', $nova_db_password = 'nova_pass', @@ -73,7 +118,7 @@ class openstack::all( # set up keystone admin users class { 'keystone::roles::admin': email => $admin_email, - password => $admin_user_password, + password => $admin_password, } # set up the keystone service and endpoint class { 'keystone::endpoint': }