diff --git a/.fixtures.yml b/.fixtures.yml index 2196943..4a0fef8 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -1,31 +1,49 @@ fixtures: repositories: - 'cinder': 'git://github.com/stackforge/puppet-cinder' - "keystone": "git://github.com/stackforge/puppet-keystone.git" - "nova": "git://github.com/stackforge/puppet-nova.git" - "glance": "git://github.com/stackforge/puppet-glance.git" - 'horizon': 'git://github.com/stackforge/puppet-horizon' - 'swift' : 'git://github.com/stackforge/puppet-swift' - 'quantum': 'git://github.com/stackforge/puppet-quantum' - 'ceilometer' : 'git://github.com/stackforge/puppet-ceilometer' - "apt": "git://github.com/puppetlabs/puppetlabs-apt.git" - "apache": - repo: "git://github.com/puppetlabs/puppetlabs-apache.git" + 'cinder': + repo: 'git://github.com/stackforge/puppet-cinder' + ref: 'origin/stable/grizzly' + 'keystone': + repo: 'git://github.com/stackforge/puppet-keystone.git' + ref: 'origin/stable/grizzly' + 'nova': + repo: 'git://github.com/stackforge/puppet-nova.git' + ref: 'origin/stable/grizzly' + 'glance': + repo: 'git://github.com/stackforge/puppet-glance.git' + ref: 'origin/stable/grizzly' + 'horizon': + repo: 'git://github.com/stackforge/puppet-horizon' + ref: 'origin/stable/grizzly' + 'swift' : + repo: 'git://github.com/stackforge/puppet-swift' + ref: 'origin/stable/grizzly' + 'quantum': + repo: 'git://github.com/stackforge/puppet-neutron' + ref: 'origin/stable/grizzly' + 'ceilometer': + repo: 'git://github.com/stackforge/puppet-ceilometer' + ref: 'origin/stable/grizzly' + 'apt': 'git://github.com/puppetlabs/puppetlabs-apt.git' + 'apache': + repo: 'git://github.com/puppetlabs/puppetlabs-apache.git' ref: 'origin/0.x' - "concat": "git://github.com/ripienaar/puppet-concat.git" - "firewall": "git://github.com/puppetlabs/puppetlabs-firewall.git" - "mysql": - repo: "git://github.com/puppetlabs/puppetlabs-mysql.git" - ref: "origin/0.x" - "rabbitmq": - repo: "git://github.com/puppetlabs/puppetlabs-rabbitmq" - ref: "origin/2.x" + 'concat': 'git://github.com/ripienaar/puppet-concat.git' + 'firewall': 'git://github.com/puppetlabs/puppetlabs-firewall.git' + 'mysql': + repo: 'git://github.com/puppetlabs/puppetlabs-mysql.git' + ref: 'origin/0.x' + 'rabbitmq': + repo: 'git://github.com/puppetlabs/puppetlabs-rabbitmq' + ref: 'origin/2.x' 'memcached': 'git://github.com/saz/puppet-memcached' - "stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git" - "sysctl": "git://github.com/duritong/puppet-sysctl.git" + 'stdlib': 'git://github.com/puppetlabs/puppetlabs-stdlib.git' + 'sysctl': 'git://github.com/duritong/puppet-sysctl.git' 'inifile': 'git://github.com/puppetlabs/puppetlabs-inifile' 'vswitch': 'git://github.com/bodepd/puppet-vswitch' - 'tempest': 'git://github.com/stackforge/puppet-tempest' + 'tempest': + repo: 'git://github.com/stackforge/puppet-tempest' + ref: 'origin/stable/grizzly' 'vcsrepo': 'git://github.com/puppetlabs/puppetlabs-vcsrepo' symlinks: - "openstack": "#{source_dir}" + 'openstack': "#{source_dir}" diff --git a/Modulefile b/Modulefile index 530ab19..2580b65 100644 --- a/Modulefile +++ b/Modulefile @@ -1,5 +1,5 @@ name 'puppetlabs-openstack' -version '2.0.0' +version '2.2.0' source 'https://github.com/stackforge/puppet-openstack' author 'Puppet Labs' license 'Apache License 2.0' @@ -7,9 +7,10 @@ summary 'Puppet Labs Openstack Module targeted for Grizzly' description 'Puppet module that pulls together all the individual components of Openstack, resulting is a complete and functional stack.' project_page 'https://github.com/stackforge/puppet-openstack' -dependency 'puppetlabs/glance', '>= 2.0.0' -dependency 'puppetlabs/horizon', '>= 2.0.0' -dependency 'puppetlabs/keystone', '>= 2.0.0' -dependency 'puppetlabs/nova', '>= 2.0.0' -dependency 'puppetlabs/cinder', '>= 2.0.0' -dependency 'puppetlabs/swift', '>= 2.0.0' +dependency 'puppetlabs/glance', '>= 2.2.0 <3.0.0' +dependency 'puppetlabs/horizon', '>= 2.2.0 <3.0.0' +dependency 'puppetlabs/keystone', '>= 2.2.0 <3.0.0' +dependency 'puppetlabs/nova', '>= 2.2.0 <3.0.0' +dependency 'puppetlabs/cinder', '>= 2.2.0 <3.0.0' +dependency 'puppetlabs/swift', '>= 2.2.0 <3.0.0' +dependency 'puppetlabs/quantum', '>= 2.2.0 <3.0.0' diff --git a/Puppetfile b/Puppetfile index c440dc7..a61e9d3 100644 --- a/Puppetfile +++ b/Puppetfile @@ -1,15 +1,32 @@ forge "http://forge.puppetlabs.com" -mod 'puppetlabs/nova', :git => 'git://github.com/stackforge/puppet-nova' -mod 'puppetlabs/glance', :git => 'git://github.com/stackforge/puppet-glance' -mod 'puppetlabs/keystone', :git => 'git://github.com/stackforge/puppet-keystone' -mod 'puppetlabs/horizon', :git => 'git://github.com/stackforge/puppet-horizon' -mod 'puppetlabs/swift', :git => 'git://github.com/stackforge/puppet-swift' -mod 'puppetlabs/cinder', :git => 'git://github.com/stackforge/puppet-cinder' -mod 'puppetlabs/tempest', :git => 'git://github.com/stackforge/puppet-tempest' -mod 'puppet/quantum', :git => 'git://github.com/stackforge/puppet-quantum/' +mod 'puppetlabs/nova', + :git => 'git://github.com/stackforge/puppet-nova', + :ref => 'origin/stable/grizzly' +mod 'puppetlabs/glance', + :git => 'git://github.com/stackforge/puppet-glance', + :ref => 'origin/stable/grizzly' +mod 'puppetlabs/keystone', + :git => 'git://github.com/stackforge/puppet-keystone', + :ref => 'origin/stable/grizzly' +mod 'puppetlabs/horizon', + :git => 'git://github.com/stackforge/puppet-horizon', + :ref => 'origin/stable/grizzly' +mod 'puppetlabs/swift', + :git => 'git://github.com/stackforge/puppet-swift', + :ref => 'origin/stable/grizzly' +mod 'puppetlabs/cinder', + :git => 'git://github.com/stackforge/puppet-cinder', + :ref => 'origin/stable/grizzly' +mod 'puppetlabs/tempest', + :git => 'git://github.com/stackforge/puppet-tempest', + :ref => 'origin/stable/grizzly' +mod 'puppet/quantum', + :git => 'git://github.com/stackforge/puppet-neutron/', + :ref => 'origin/stable/grizzly' # openstack middleware -mod 'puppet/vswitch', :git => 'git://github.com/bodepd/puppet-vswitch' +mod 'puppet/vswitch', + :git => 'git://github.com/bodepd/puppet-vswitch' mod 'puppetlabs/rabbitmq', :git => 'git://github.com/puppetlabs/puppetlabs-rabbitmq', :ref => 'origin/2.x' diff --git a/README.md b/README.md index 8572ac3..cdf96f3 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,8 @@ The swift portions of this module needs Puppet's [exported resources](http://doc cd /etc/puppet/modules git clone git://github.com/stackforge/puppet-openstack.git openstack cd openstack + # to use the grizzly version of the module + git checkout origin/stable/grizzly gem install librarian-puppet librarian-puppet install --path ../ @@ -504,6 +506,54 @@ Contributors Release Notes ------------- +**2.2.0** + +* Added support for syslog. +* Added passing keystone_host to controller class to support non-local keystone server. +* Added parameter for memcached_servers to support multiple memcache servers. +* Fixed bug to make vncserver_listen default to internal_address if not set. +* Added force_config_drive to openstack::all. +* Added support for rdb volumes. +* Added support for rdb as glance backend. +* Added ovs network provider. +* Added support for keystone token_format and token_driver. +* Fixed reference to 'quantum' repository to reflect upstream change to puppet-neutron. +* Added support for security_group_api. +* Fixed swift keystone authentication endpoints. +* Fixed selinux logic for horizon. + +**2.1.0** + +* Added support for Quantum OVS VLAN networking. +* Added Quantum firewall driver at top scope parameter. +* Added support for Glance Registry MySQL Idle Timeout +* Added support for debug logging. +* Added rdb/ceph backend support to Glance. +* Added rdb/ceph backend support to Cinder. +* Added support for splitting proxy and storage networks. +* Added support for memcached. +* Added support for RabbitMQ clustering. +* Added support for Nova API Bind Address. +* Added support for SQL Idle Timeout. +* Added suport for debug logging. +* Added support for RabbitMQ mirrored queues. +* Added support for RDO setup on additional RedHat based systems. +* Added swift_public_address. +* Added configuration for Swift auth in controller. +* Reintroduces support for provider networks. +* Propogates both internal and admin addresses to services. +* Passes through quantum core plugin. +* Exposes public_protocol parameter in openstack::controller. +* Exposes Glance registry_host parameter. +* Fixed authentication host parameter bug to use real_keystone_host. +* Fixed selinux Horizon bug. +* Fixed Keystone 'token-get' bug. +* Removed unneeded ovs_local_ip error message. +* Disabled dhcp on provisioned public subnet. +* Allows ovs_enable_tunneling to be passed through. +* Pinned module dependencies. +* Various lint and bug fixes. + **2.0.0** * Upstream is now part of stackfoge. diff --git a/Rakefile b/Rakefile index c695794..3adf833 100644 --- a/Rakefile +++ b/Rakefile @@ -1,39 +1,5 @@ -# -# Rakefile to make management of module easier (I hope :) ) -# -# I did not do this in puppet b/c it requires the vcsrepo!! -# -# +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' -begin - require 'yaml' - require 'puppetlabs_spec_helper/rake_tasks' -rescue LoadError - puts "!!!!!" - puts "puppetlabs_spec_helper not found. This may cause some rake tasks to be unavailable." - puts "!!!!!" -end - -namespace :github do - desc 'check all dependeny projects and generate a report about open pull requests' - task 'pull_request_stats' do - require 'net/https' - require 'uri' - require 'puppet' - repo_hash = YAML.load_file(File.join(File.dirname(__FILE__), repo_file)) - (repo_hash['repos'] || {})['repo_paths'].keys.each do |url| - if url =~ /\w+:\/\/github\.com\/(\S+)?\/(\S+)/ - uri = URI.parse("https://api.github.com/repos/#{$1}/#{$2}/pulls") - http = Net::HTTP.new(uri.host, uri.port) - http.use_ssl = true - http.verify_mode = OpenSSL::SSL::VERIFY_NONE - request = Net::HTTP::Get.new(uri.request_uri) - response = http.request(request) - pull_requests = PSON.parse(response.body).size - puts "repo: #{$1}-#{$2}=#{pull_requests}" - else - puts "repo: #{url} does not seem to be valid" - end - end - end -end +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.send('disable_class_parameter_defaults') diff --git a/manifests/all.pp b/manifests/all.pp index d0fcf8c..ca98e96 100644 --- a/manifests/all.pp +++ b/manifests/all.pp @@ -45,6 +45,10 @@ # [cache_server_port] local memcached instance port # [horizon] (bool) is horizon installed. Defaults to: true # [quantum] (bool) is quantum installed +# [network_vlan_ranges] array of vlan_start:vlan_stop groups +# [bridge_mappings] array of physical_newtork:l2_start:l2end groups +# [bridge_uplinks] array of bridge_name:bridge_interface groups +# [tenant_network_type] vlan, gre, etc. # The next is an array of arrays, that can be used to add call-out links to the dashboard for other apps. # There is no specific requirement for these apps to be for monitoring, that's just the defacto purpose. # Each app is defined in two parts, the display name, and the URI @@ -143,6 +147,9 @@ # Glance Swift Backend $swift_store_user = 'swift_store_user', $swift_store_key = 'swift_store_key', + # Glance RBD Backend + $glance_rbd_user = 'images', + $glance_rbd_pool = 'images', # Nova $nova_admin_tenant_name = 'services', $nova_admin_user = 'nova', @@ -151,6 +158,7 @@ $purge_nova_config = false, $libvirt_vif_driver = 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver', $enabled_apis = 'ec2,osapi_compute,metadata', + $force_config_drive = false, # Virtualization $libvirt_type = 'kvm', $migration_support = false, @@ -189,6 +197,10 @@ $setup_test_volume = false, $volume_group = 'cinder-volumes', $iscsi_ip_address = '127.0.0.1', + $cinder_volume_driver = 'iscsi', + $cinder_rbd_user = 'volumes', + $cinder_rbd_pool = 'volumes', + $cinder_rbd_secret_uuid = false, # Quantum $quantum = true, $bridge_interface = undef, @@ -204,6 +216,10 @@ $quantum_auth_url = 'http://127.0.0.1:35357/v2.0', $enable_quantum_server = true, $ovs_local_ip = false, + $network_vlan_ranges = undef, + $bridge_mappings = undef, + $bridge_uplinks = undef, + $tenant_network_type = 'gre', # General $verbose = false, $enabled = true @@ -233,7 +249,7 @@ if $vncserver_listen { $vncserver_listen_real = $vncserver_listen } else { - $vncserver_listen_real = $internal_address + $vncserver_listen_real = $internal_address_real } if $glance_api_servers { $glance_api_servers_real = $glance_api_servers @@ -321,6 +337,8 @@ backend => $glance_backend, swift_store_user => $swift_store_user, swift_store_key => $swift_store_key, + rbd_store_user => $glance_rbd_user, + rbd_store_pool => $glance_rbd_pool, enabled => $enabled, } @@ -340,7 +358,8 @@ enabled => $enabled, vnc_enabled => $vnc_enabled, vncserver_proxyclient_address => $internal_address_real, - vncproxy_host => $vncproxy_host, + vncproxy_host => $vncproxy_host_real, + force_config_drive => $force_config_drive } # Configure libvirt for nova-compute @@ -408,6 +427,18 @@ fail('bridge_interface must be set when configuring quantum') } + if ! $bridge_mappings { + $bridge_mappings_real = ["default:${external_bridge_name}"] + } else { + $bridge_mappings_real = $bridge_mappings + } + + if ! $bridge_uplinks { + $bridge_uplinks_real = ["${external_bridge_name}:${bridge_interface}"] + } else { + $bridge_uplinks_real = $bridge_uplinks + } + class { 'openstack::quantum': # Database db_host => $db_host, @@ -418,10 +449,12 @@ rabbit_virtual_host => $rabbit_virtual_host, # Quantum OVS ovs_local_ip => $ovs_local_ip_real, - bridge_uplinks => ["${external_bridge_name}:${bridge_interface}"], - bridge_mappings => ["default:${external_bridge_name}"], + bridge_uplinks => $bridge_uplinks_real, + bridge_mappings => $bridge_mappings_real, enable_ovs_agent => $enable_ovs_agent, firewall_driver => $firewall_driver, + tenant_network_type => $tenant_network_type, + network_vlan_ranges => $network_vlan_ranges, # Database db_name => $quantum_db_name, db_user => $quantum_db_user, @@ -486,6 +519,10 @@ db_type => $db_type, db_host => $db_host, iscsi_ip_address => $iscsi_ip_address, + volume_driver => $cinder_volume_driver, + rbd_user => $cinder_rbd_user, + rbd_pool => $cinder_rbd_pool, + rbd_secret_uuid => $cinder_rbd_secret_uuid, setup_test_volume => $setup_test_volume, manage_volumes => $manage_volumes, volume_group => $volume_group, diff --git a/manifests/cinder/all.pp b/manifests/cinder/all.pp index 38a2212..88beb06 100644 --- a/manifests/cinder/all.pp +++ b/manifests/cinder/all.pp @@ -28,8 +28,13 @@ $volume_group = 'cinder-volumes', $volume_driver = 'iscsi', $iscsi_ip_address = '127.0.0.1', + $rbd_user = 'volumes', + $rbd_pool = 'volumes', + $rbd_secret_uuid = false, $setup_test_volume = false, $manage_volumes = true, + $use_syslog = false, + $log_facility = 'LOG_USER', $verbose = false ) { @@ -52,6 +57,8 @@ rabbit_virtual_host => $rabbit_virtual_host, package_ensure => $package_ensure, api_paste_config => $api_paste_config, + use_syslog => $use_syslog, + log_facility => $log_facility, verbose => $verbose, } @@ -91,6 +98,12 @@ volume_name => $volume_group, } } + } elsif $volume_driver == 'rbd' { + class { 'cinder::volume::rbd': + rbd_pool => $rbd_pool, + rbd_user => $rbd_user, + rbd_secret_uuid => $rbd_secret_uuid, + } } else { warning("Unsupported volume driver: ${volume_driver}, make sure you are configuring this yourself") } diff --git a/manifests/cinder/controller.pp b/manifests/cinder/controller.pp index 38b5b20..856142f 100644 --- a/manifests/cinder/controller.pp +++ b/manifests/cinder/controller.pp @@ -29,6 +29,8 @@ $scheduler_driver = 'cinder.scheduler.simple.SimpleScheduler', $api_enabled = true, $scheduler_enabled = true, + $use_syslog = false, + $log_facility = 'LOG_USER', $debug = false, $verbose = false ) { @@ -53,6 +55,8 @@ rabbit_virtual_host => $rabbit_virtual_host, package_ensure => $package_ensure, api_paste_config => $api_paste_config, + use_syslog => $use_syslog, + log_facility => $log_facility, debug => $debug, verbose => $verbose, } diff --git a/manifests/compute.pp b/manifests/compute.pp index f7204f6..b6ff77e 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -63,6 +63,7 @@ $quantum_firewall_driver = false, $bridge_mappings = undef, $bridge_uplinks = undef, + $security_group_api = 'quantum', # Nova $nova_admin_tenant_name = 'services', $nova_admin_user = 'nova', @@ -96,6 +97,7 @@ # General $migration_support = false, $verbose = false, + $force_config_drive = false, $enabled = true ) { @@ -144,6 +146,7 @@ vnc_enabled => $vnc_enabled, vncserver_proxyclient_address => $internal_address, vncproxy_host => $vncproxy_host, + force_config_drive => $force_config_drive, } # Configure libvirt for nova-compute @@ -213,6 +216,7 @@ ovs_local_ip => $ovs_local_ip_real, # Rabbit rabbit_host => $rabbit_host, + rabbit_hosts => $rabbit_hosts, rabbit_user => $rabbit_user, rabbit_password => $rabbit_password, # Quantum OVS @@ -246,6 +250,7 @@ quantum_admin_username => $quantum_admin_user, quantum_admin_tenant_name => $quantum_admin_tenant_name, quantum_admin_auth_url => "http://${keystone_host}:35357/v2.0", + security_group_api => $security_group_api } } @@ -263,6 +268,7 @@ rabbit_password => $rabbit_password, rabbit_userid => $rabbit_user, rabbit_host => $rabbit_host, + rabbit_hosts => $rabbit_hosts, rabbit_virtual_host => $rabbit_virtual_host, volume_group => $volume_group, iscsi_ip_address => $iscsi_ip_address, diff --git a/manifests/controller.pp b/manifests/controller.pp index a2d2e4e..9d23fd5 100644 --- a/manifests/controller.pp +++ b/manifests/controller.pp @@ -6,6 +6,8 @@ # [public_interface] Public interface used to route public traffic. Required. # [public_address] Public address for public endpoints. Required. # [public_protocol] Protocol used by public endpoints. Defaults to 'http' +# [token_format] Format keystone uses for tokens. Optional. Defaults to PKI. +# Supports PKI and UUID. # [private_interface] Interface used for vm networking connectivity. Required. # [internal_address] Internal address used for management. Required. # [mysql_root_password] Root password for mysql server. @@ -17,12 +19,16 @@ # [keystone_admin_token] Admin token for keystone. # [keystone_bind_address] Address that keystone api service should bind to. # Optional. Defaults to '0.0.0.0'. +# [keystone_token_driver] Driver to use for managing tokens. +# Optional. Defaults to 'keystone.token.backends.kvs.Token' # [glance_registry_host] Address used by Glance API to find the Glance Registry service. # Optional. Defaults to '0.0.0.0'. # [glance_db_password] Glance DB password. # [glance_user_password] Glance service user password. # [nova_db_password] Nova DB password. # [nova_user_password] Nova service password. +# [nova_memcached_servers] (array) List of memcached servers for use with nova. +# (optional) Defaults to false. Values should be hostname:port format. # # [purge_nova_config] # Whether unmanaged nova.conf entries should be purged. @@ -108,9 +114,25 @@ # (Optional) Defaults to false. Required if swift is set to true. # # [swift_public_address] -# The swift address used to populate the keystone service catalog. +# The swift public endpoint address used to populate the keystone service catalog. # (optional). Defaults to false. # +# [swift_internal_address] +# The swift internal endpoint address used to populate the keystone service catalog. +# (optional). Defaults to false. +# +# [swift_admin_address] +# The swift admin endpoint address used to populate the keystone service catalog. +# (optional). Defaults to false. +# +# [use_syslog] +# Use syslog for logging. +# (Optional) Defaults to false. +# +# [log_facility] +# Syslog facility to receive log lines. +# (Optional) Defaults to LOG_USER. +# # === Examples # # class { 'openstack::controller': @@ -141,6 +163,7 @@ $glance_user_password, $nova_db_password, $nova_user_password, + $nova_memcached_servers = false, $secret_key, $mysql_root_password, # cinder and quantum password are not required b/c they are @@ -166,12 +189,16 @@ $keystone_bind_address = '0.0.0.0', $region = 'RegionOne', $public_protocol = 'http', + $keystone_token_driver = 'keystone.token.backends.kvs.Token', + $token_format = 'PKI', # Glance $glance_registry_host = '0.0.0.0', $glance_db_user = 'glance', $glance_db_dbname = 'glance', $glance_api_servers = undef, $glance_backend = 'file', + $glance_rbd_store_user = undef, + $glance_rbd_store_pool = undef, # Glance Swift Backend $swift_store_user = 'swift_store_user', $swift_store_key = 'swift_store_key', @@ -240,9 +267,15 @@ $quantum_db_name = 'quantum', $quantum_auth_url = 'http://127.0.0.1:35357/v2.0', $enable_quantum_server = true, + $security_group_api = 'quantum', # swift $swift = false, $swift_public_address = false, + $swift_internal_address = false, + $swift_admin_address = false, + # Syslog + $use_syslog = false, + $log_facility = 'LOG_USER', $enabled = true ) { @@ -321,8 +354,10 @@ admin_tenant => $keystone_admin_tenant, admin_email => $admin_email, admin_password => $admin_password, + token_driver => $keystone_token_driver, public_address => $public_address, public_protocol => $public_protocol, + token_format => $token_format, internal_address => $internal_address_real, admin_address => $admin_address_real, region => $region, @@ -343,10 +378,12 @@ swift => $swift, swift_user_password => $swift_user_password, swift_public_address => $swift_public_address, - swift_internal_address => $internal_address_real, - swift_admin_address => $admin_address_real, + swift_internal_address => $swift_internal_address, + swift_admin_address => $swift_admin_address, enabled => $enabled, bind_host => $keystone_bind_address, + use_syslog => $use_syslog, + log_facility => $log_facility, } @@ -366,6 +403,10 @@ backend => $glance_backend, swift_store_user => $swift_store_user, swift_store_key => $swift_store_key, + rbd_store_user => $glance_rbd_store_user, + rbd_store_pool => $glance_rbd_store_pool, + use_syslog => $use_syslog, + log_facility => $log_facility, enabled => $enabled, } @@ -402,6 +443,7 @@ quantum => $quantum, quantum_user_password => $quantum_user_password, metadata_shared_secret => $metadata_shared_secret, + security_group_api => $security_group_api, # Nova nova_admin_tenant_name => $nova_admin_tenant_name, nova_admin_user => $nova_admin_user, @@ -409,6 +451,7 @@ nova_db_password => $nova_db_password, nova_db_user => $nova_db_user, nova_db_dbname => $nova_db_dbname, + memcached_servers => $nova_memcached_servers, enabled_apis => $enabled_apis, api_bind_address => $nova_bind_address, # Rabbit @@ -419,9 +462,14 @@ rabbit_virtual_host => $rabbit_virtual_host, # Glance glance_api_servers => $glance_api_servers, + # Keystone + keystone_host => $keystone_host, # VNC vnc_enabled => $vnc_enabled, vncproxy_host => $vncproxy_host_real, + # Syslog + use_syslog => $use_syslog, + log_facility => $log_facility, # General debug => $debug, verbose => $verbose, @@ -489,6 +537,9 @@ shared_secret => $metadata_shared_secret, # Keystone keystone_host => $keystone_host, + # Syslog + use_syslog => $use_syslog, + log_facility => $log_facility, # General enabled => $enabled, enable_server => $enable_quantum_server, @@ -524,6 +575,8 @@ db_host => $db_host, api_enabled => $enabled, scheduler_enabled => $enabled, + use_syslog => $use_syslog, + log_facility => $log_facility, debug => $debug, verbose => $verbose } @@ -536,6 +589,7 @@ cache_server_ip => $cache_server_ip, cache_server_port => $cache_server_port, horizon_app_links => $horizon_app_links, + keystone_host => $keystone_host, } } diff --git a/manifests/glance.pp b/manifests/glance.pp index 9aa4734..7a1980e 100644 --- a/manifests/glance.pp +++ b/manifests/glance.pp @@ -28,6 +28,8 @@ # [swift_store_auth_addres] The URL where the Swift auth service lives. Defaults to "http://${keystone_host}:5000/v2.0/" # [verbose] Log verbosely. Optional. Defaults to false. # [debug] Log at a debug-level. Optional. Defaults to false. +# [use_syslog] Use syslog for logging. Optional. Defaults to false. +# [syslog_facility] Syslog facility to receive log lines. Optional. Defaults to LOG_USER. # [enabled] Used to indicate if the service should be active (true) or passive (false). # Optional. Defaults to true # @@ -58,6 +60,8 @@ $rbd_store_pool = 'images', $verbose = false, $debug = false, + $use_syslog = false, + $log_facility = 'LOG_USER', $enabled = true ) { @@ -82,6 +86,8 @@ keystone_password => $user_password, sql_connection => $sql_connection, sql_idle_timeout => $sql_idle_timeout, + use_syslog => $use_syslog, + log_facility => $log_facility, enabled => $enabled, } @@ -98,6 +104,8 @@ keystone_password => $user_password, sql_connection => $sql_connection, sql_idle_timeout => $sql_idle_timeout, + use_syslog => $use_syslog, + log_facility => $log_facility, enabled => $enabled, } diff --git a/manifests/horizon.pp b/manifests/horizon.pp index 39eba7c..a3f6dd3 100644 --- a/manifests/horizon.pp +++ b/manifests/horizon.pp @@ -101,7 +101,7 @@ api_result_limit => $api_result_limit, } - if $::selinux and $::selinux != 'false' { + if str2bool($::selinux) { selboolean{'httpd_can_network_connect': value => on, persistent => true, diff --git a/manifests/keystone.pp b/manifests/keystone.pp index a49ff51..06d0a41 100644 --- a/manifests/keystone.pp +++ b/manifests/keystone.pp @@ -15,12 +15,16 @@ # [nova_user_password] Auth password for nova user. Required. # [public_address] Public address where keystone can be accessed. Required. # [public_protocol] Public protocol over which keystone can be accessed. Defaults to 'http' +# [token_format] Format keystone uses for tokens. Optional. Defaults to PKI. +# Supports PKI and UUID. # [db_type] Type of DB used. Currently only supports mysql. Optional. Defaults to 'mysql' # [db_user] Name of keystone db user. Optional. Defaults to 'keystone' # [db_name] Name of keystone DB. Optional. Defaults to 'keystone' # [admin_tenant] Name of keystone admin tenant. Optional. Defaults to 'admin' # [verbose] Log verbosely. Optional. Defaults to false. # [debug] Log at a debug-level. Optional. Defaults to false. +# [token_driver] Driver to use for managing tokens. +# Optional. Defaults to 'keystone.token.backends.kvs.Token' # [bind_host] Address that keystone binds to. Optional. Defaults to '0.0.0.0' # [internal_address] Internal address for keystone. Optional. Defaults to $public_address # [admin_address] Keystone admin address. Optional. Defaults to $internal_address @@ -30,6 +34,8 @@ # [swift_user_password] # Auth password for swift. # (Optional) Defaults to false. +# [use_syslog] Use syslog for logging. Defaults to false. +# [log_facility] Syslog facility to receive log lines. Defaults to LOG_USER. # [enabled] If the service is active (true) or passive (false). # Optional. Defaults to true # @@ -59,6 +65,7 @@ $quantum_user_password, $public_address, $public_protocol = 'http', + $token_format = 'PKI', $db_host = '127.0.0.1', $idle_timeout = '200', $swift_user_password = false, @@ -70,6 +77,7 @@ $debug = false, $bind_host = '0.0.0.0', $region = 'RegionOne', + $token_driver = 'keystone.token.backends.kvs.Token', $internal_address = false, $admin_address = false, $glance_public_address = false, @@ -92,6 +100,8 @@ $cinder = true, $quantum = true, $swift = false, + $use_syslog = false, + $log_facility = 'LOG_USER', $enabled = true ) { @@ -197,8 +207,12 @@ idle_timeout => $idle_timeout, catalog_type => 'sql', admin_token => $admin_token, + token_driver => $token_driver, + token_format => $token_format, enabled => $enabled, sql_connection => $sql_conn, + use_syslog => $use_syslog, + log_facility => $log_facility, } if ($enabled) { diff --git a/manifests/nova/controller.pp b/manifests/nova/controller.pp index 27918fe..4b94ccc 100644 --- a/manifests/nova/controller.pp +++ b/manifests/nova/controller.pp @@ -36,6 +36,14 @@ # Timeout for sql to reap connections. # (Optional) Defaults to '3600'. # +# [use_syslog] +# Use syslog for logging. +# (Optional) Defaults to false. +# +# [log_facility] +# Syslog facility to receive log lines. +# (Optional) Defaults to LOG_USER. +# # === Examples # # class { 'openstack::nova::controller': @@ -74,6 +82,7 @@ $quantum = true, $quantum_user_password = false, $metadata_shared_secret = undef, + $security_group_api = 'quantum', # Nova $nova_admin_tenant_name = 'services', $nova_admin_user = 'nova', @@ -97,6 +106,9 @@ $vncproxy_host = undef, # Keystone $keystone_host = '127.0.0.1', + # Syslog + $use_syslog = false, + $log_facility = 'LOG_USER', # General $debug = false, $verbose = false, @@ -150,6 +162,8 @@ verbose => $verbose, rabbit_host => $rabbit_connection, rabbit_hosts => $rabbit_hosts, + use_syslog => $use_syslog, + log_facility => $log_facility, } # Configure nova-api @@ -217,6 +231,7 @@ quantum_admin_tenant_name => 'services', quantum_admin_username => 'quantum', quantum_admin_auth_url => "http://${keystone_host}:35357/v2.0", + security_group_api => $security_group_api, } } diff --git a/manifests/provision.pp b/manifests/provision.pp index 3dd6c3c..254f048 100644 --- a/manifests/provision.pp +++ b/manifests/provision.pp @@ -73,7 +73,8 @@ $tempest_clone_owner = 'root', $setup_venv = false, $resize_available = undef, - $change_password_available = undef + $change_password_available = undef, + $quantum_available = true ) { ## Users @@ -113,51 +114,65 @@ ## Networks - quantum_network { $public_network_name: - ensure => present, - router_external => true, - tenant_name => $admin_tenant_name, - } - quantum_subnet { $public_subnet_name: - ensure => 'present', - cidr => $floating_range, - enable_dhcp => false, - network_name => $public_network_name, - tenant_name => $admin_tenant_name, - } - quantum_network { $private_network_name: - ensure => present, - tenant_name => $tenant_name, - } - quantum_subnet { $private_subnet_name: - ensure => present, - cidr => $fixed_range, - network_name => $private_network_name, - tenant_name => $tenant_name, - } - # Tenant-owned router - assumes network namespace isolation - quantum_router { $router_name: - ensure => present, - tenant_name => $tenant_name, - gateway_network_name => $public_network_name, - # A quantum_router resource must explicitly declare a dependency on - # the first subnet of the gateway network. - require => Quantum_subnet[$public_subnet_name], - } - quantum_router_interface { "${router_name}:${private_subnet_name}": - ensure => present, - } + if $quantum_available { + $quantum_deps = [Quantum_network[$public_network_name]] - if $setup_ovs_bridge { - quantum_l3_ovs_bridge { $public_bridge_name: + quantum_network { $public_network_name: + ensure => present, + router_external => true, + tenant_name => $admin_tenant_name, + } + quantum_subnet { $public_subnet_name: + ensure => 'present', + cidr => $floating_range, + enable_dhcp => false, + network_name => $public_network_name, + tenant_name => $admin_tenant_name, + } + quantum_network { $private_network_name: ensure => present, - subnet_name => $public_subnet_name, + tenant_name => $tenant_name, + } + quantum_subnet { $private_subnet_name: + ensure => present, + cidr => $fixed_range, + network_name => $private_network_name, + tenant_name => $tenant_name, + } + # Tenant-owned router - assumes network namespace isolation + quantum_router { $router_name: + ensure => present, + tenant_name => $tenant_name, + gateway_network_name => $public_network_name, + # A quantum_router resource must explicitly declare a dependency on + # the first subnet of the gateway network. + require => Quantum_subnet[$public_subnet_name], + } + quantum_router_interface { "${router_name}:${private_subnet_name}": + ensure => present, + } + + if $setup_ovs_bridge { + quantum_l3_ovs_bridge { $public_bridge_name: + ensure => present, + subnet_name => $public_subnet_name, + } } } + else { + $quantum_deps = [] + #TODO(marun): Provision for nova network + } ## Tempest if $configure_tempest { + $tempest_requires = concat([ + Keystone_user[$username], + Keystone_user[$alt_username], + Glance_image[$image_name], + ], $quantum_deps) + class { 'tempest': tempest_repo_uri => $tempest_repo_uri, tempest_clone_path => $tempest_clone_path, @@ -178,16 +193,11 @@ admin_username => $admin_username, admin_password => $admin_password, admin_tenant_name => $admin_tenant_name, - quantum_available => true, + quantum_available => $quantum_available, public_network_name => $public_network_name, resize_available => $resize_available, change_password_available => $change_password_available, - require => [ - Keystone_user[$username], - Keystone_user[$alt_username], - Glance_image[$image_name], - Quantum_network[$public_network_name], - ], + require => $tempest_requires, } } diff --git a/manifests/quantum.pp b/manifests/quantum.pp index fcb6336..360e415 100644 --- a/manifests/quantum.pp +++ b/manifests/quantum.pp @@ -129,6 +129,14 @@ # Host running keystone. # (optional) Defaults to 127.0.0.1. # +# [use_syslog] +# Use syslog for logging. +# (optional) Default to false. +# +# [log_facility] +# Syslog facility to receive log lines. +# (optional) Default to LOG_USER. +# # [verbose] # Enables verbose for quantum services. # (optional) Defaults to false. @@ -194,6 +202,8 @@ # General $bind_address = '0.0.0.0', $keystone_host = '127.0.0.1', + $use_syslog = false, + $log_facility = 'LOG_USER', $verbose = false, $debug = false, ) { @@ -207,6 +217,8 @@ rabbit_virtual_host => $rabbit_virtual_host, rabbit_user => $rabbit_user, rabbit_password => $rabbit_password, + use_syslog => $use_syslog, + log_facility => $log_facility, verbose => $verbose, debug => $debug, } diff --git a/spec/classes/openstack_all_spec.rb b/spec/classes/openstack_all_spec.rb index f692784..c6e1ebb 100644 --- a/spec/classes/openstack_all_spec.rb +++ b/spec/classes/openstack_all_spec.rb @@ -125,6 +125,70 @@ ) end end + + context 'with quantum_user_password, quantum_db_password, bridge_interface, ovs_local_ip, metadata_shared_secret, and force_config_drive set' do + before do + params.merge!( + :quantum_user_password => 'quantum_user_password', + :quantum_db_password => 'quantum_db_password', + :bridge_interface => 'eth0', + :ovs_local_ip => '10.0.1.1', + :metadata_shared_secret => 'shared_md_secret', + :force_config_drive => true + ) + end + it 'contains a nova::compute class with force_config_drive set' do + should contain_class('nova::compute').with( + :enabled => true, + :force_config_drive => true + ) + end + end + + context 'with quantum_user_password, quantum_db_password, bridge_interface, ovs_local_ip, bridge_mappings, bridge_uplinks, and shared_secret set' do + before do + params.merge!( + :quantum_user_password => 'quantum_user_password', + :quantum_db_password => 'quantum_db_password', + :bridge_interface => 'eth0', + :ovs_local_ip => '10.0.1.1', + :network_vlan_ranges => '1:1000', + :bridge_mappings => ['intranet:br-intra','extranet:br-extra'], + :bridge_uplinks => ['intranet:eth1','extranet:eth2'], + :tenant_network_type => 'vlan', + :metadata_shared_secret => 'shared_md_secret' + ) + end + it 'contains an openstack::quantum class' do + should contain_class('openstack::quantum').with( + :db_host => '127.0.0.1', + :rabbit_host => '127.0.0.1', + :rabbit_user => 'openstack', + :rabbit_password => 'rabbit_pw', + :rabbit_virtual_host => '/', + :ovs_local_ip => '10.0.1.1', + :network_vlan_ranges => '1:1000', + :bridge_uplinks => ['intranet:eth1','extranet:eth2'], + :bridge_mappings => ['intranet:br-intra','extranet:br-extra'], + :tenant_network_type => 'vlan', + :enable_ovs_agent => true, + :firewall_driver => 'quantum.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver', + :db_name => 'quantum', + :db_user => 'quantum', + :db_password => 'quantum_db_password', + :enable_dhcp_agent => true, + :enable_l3_agent => true, + :enable_metadata_agent => true, + :auth_url => 'http://127.0.0.1:35357/v2.0', + :user_password => 'quantum_user_password', + :shared_secret => 'shared_md_secret', + :keystone_host => '127.0.0.1', + :enabled => true, + :enable_server => true, + :verbose => false + ) + end + end end context 'cinder enabled (which is the default)' do @@ -180,6 +244,30 @@ end end + context 'cinder enabled and Ceph RBD as the backend' do + before do + params.merge!( + :quantum_user_password => 'quantum_user_password', + :quantum_db_password => 'quantum_db_password', + :bridge_interface => 'eth0', + :ovs_local_ip => '10.0.1.1', + :metadata_shared_secret => 'shared_md_secret', + :cinder_db_password => 'cinder_db_password', + :cinder_user_password => 'cinder_user_password', + :cinder_volume_driver => 'rbd', + :cinder_rbd_secret_uuid => 'e80afa94-a64c-486c-9e34-d55e85f26406' + ) + end + + it 'should have cinder::volume::rbd' do + should contain_class('cinder::volume::rbd').with( + :rbd_pool => 'volumes', + :rbd_user => 'volumes', + :rbd_secret_uuid => 'e80afa94-a64c-486c-9e34-d55e85f26406' + ) + end + end + context 'cinder and quantum enabled (which is the default)' do before do params.merge!( @@ -267,14 +355,14 @@ :enabled => true, :vnc_enabled => true, :vncserver_proxyclient_address => '10.0.0.1', - :vncproxy_host => false + :vncproxy_host => '10.0.0.1' ) end it 'should have nova::compute::libvirt configured' do should contain_class('nova::compute::libvirt').with( :libvirt_type => 'kvm', - :vncserver_listen => false, + :vncserver_listen => '10.0.0.1', :migration_support => false ) end @@ -395,4 +483,26 @@ ) end end + + context 'glance enabled and rbd as the backend' do + before do + params.merge!( + :quantum_user_password => 'quantum_user_password', + :quantum_db_password => 'quantum_db_password', + :bridge_interface => 'eth0', + :ovs_local_ip => '10.0.1.1', + :metadata_shared_secret => 'shared_md_secret', + :cinder_db_password => 'cinder_db_password', + :cinder_user_password => 'cinder_user_password', + :glance_backend => 'rbd' + ) + end + + it 'should have glance::backend::rbd with default user/pool' do + should contain_class('glance::backend::rbd').with( + :rbd_store_user => 'images', + :rbd_store_pool => 'images' + ) + end + end end diff --git a/spec/classes/openstack_cinder_all_spec.rb b/spec/classes/openstack_cinder_all_spec.rb index 7b49cb6..71f2d3d 100644 --- a/spec/classes/openstack_cinder_all_spec.rb +++ b/spec/classes/openstack_cinder_all_spec.rb @@ -26,6 +26,8 @@ :rabbit_virtual_host => '/', :package_ensure => 'present', :api_paste_config => '/etc/cinder/api-paste.ini', + :use_syslog => false, + :log_facility => 'LOG_USER', :verbose => false ) should contain_class('cinder::api').with( @@ -74,6 +76,24 @@ it { should_not contain_class('cinder::volume::iscsi') } end + describe 'with a volume driver other than rbd' do + before do + params.merge!( + :volume_driver => 'netapp' + ) + end + it { should_not contain_class('cinder::volume::rbd') } + end + + describe 'with the rbd volume driver' do + before do + params.merge!( + :volume_driver => 'rbd' + ) + end + it { should contain_class('cinder::volume::rbd') } + end + describe 'when setting up test volumes for iscsi' do before do params.merge!( @@ -93,6 +113,19 @@ end end + describe 'with custom syslog settings' do + before do + params.merge!( + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + ) + end + it { should contain_class('cinder').with( + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + )} + end + context 'with unsupported db type' do before do diff --git a/spec/classes/openstack_cinder_controller_spec.rb b/spec/classes/openstack_cinder_controller_spec.rb index 8d922f7..518e081 100644 --- a/spec/classes/openstack_cinder_controller_spec.rb +++ b/spec/classes/openstack_cinder_controller_spec.rb @@ -27,6 +27,8 @@ :rabbit_virtual_host => '/', :package_ensure => 'present', :api_paste_config => '/etc/cinder/api-paste.ini', + :use_syslog => false, + :log_facility => 'LOG_USER', :debug => false, :verbose => false ) @@ -49,6 +51,22 @@ ) end + describe 'with custom syslog settings' do + before do + params.merge!({ + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + }) + end + + it do + should contain_class('cinder').with( + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + ) + end + end + context 'with unsupported db type' do before do diff --git a/spec/classes/openstack_compute_spec.rb b/spec/classes/openstack_compute_spec.rb index 7eb34a2..29b95d9 100644 --- a/spec/classes/openstack_compute_spec.rb +++ b/spec/classes/openstack_compute_spec.rb @@ -46,7 +46,8 @@ :enabled => true, :vnc_enabled => true, :vncserver_proxyclient_address => '127.0.0.2', - :vncproxy_host => false + :vncproxy_host => false, + :force_config_drive => false ) should contain_class('nova::compute::libvirt').with( :libvirt_type => 'kvm', @@ -103,6 +104,7 @@ :libvirt_type => 'qemu', :vncproxy_host => '127.0.0.2', :vnc_enabled => false, + :force_config_drive => true, :verbose => true ) end @@ -122,7 +124,8 @@ :enabled => true, :vnc_enabled => false, :vncserver_proxyclient_address => '127.0.0.1', - :vncproxy_host => '127.0.0.2' + :vncproxy_host => '127.0.0.2', + :force_config_drive => true ) should contain_class('nova::compute::libvirt').with( :libvirt_type => 'qemu', @@ -315,7 +318,8 @@ :quantum_url => "http://127.0.0.2:9696", :quantum_admin_tenant_name => 'services', :quantum_admin_username => 'quantum', - :quantum_admin_auth_url => "http://127.0.0.3:35357/v2.0" + :quantum_admin_auth_url => "http://127.0.0.3:35357/v2.0", + :security_group_api => 'quantum' ) should_not contain_class('quantum::server') diff --git a/spec/classes/openstack_controller_spec.rb b/spec/classes/openstack_controller_spec.rb index 113fc2d..b16712f 100644 --- a/spec/classes/openstack_controller_spec.rb +++ b/spec/classes/openstack_controller_spec.rb @@ -16,12 +16,15 @@ :rabbit_virtual_host => '/', :keystone_db_password => 'keystone_pass', :keystone_admin_token => 'keystone_admin_token', + :keystone_token_driver => 'keystone.token.backends.kvs.Token', + :keystone_host => '127.0.0.1', :glance_registry_host => '0.0.0.0', :glance_db_password => 'glance_pass', :glance_user_password => 'glance_pass', :nova_bind_address => '0.0.0.0', :nova_db_password => 'nova_pass', :nova_user_password => 'nova_pass', + :nova_memcached_servers => false, :cinder_db_password => 'cinder_pass', :cinder_user_password => 'cinder_pass', :secret_key => 'secret_key', @@ -183,9 +186,13 @@ it 'should configure default keystone configuration' do should contain_class('openstack::keystone').with( - :swift => false, - :swift_user_password => false, - :swift_public_address => false + :swift => false, + :swift_user_password => false, + :swift_public_address => false, + :swift_internal_address => false, + :swift_admin_address => false, + :use_syslog => false, + :log_facility => 'LOG_USER' ) should contain_class('keystone').with( @@ -194,6 +201,8 @@ :catalog_type => 'sql', :enabled => true, :admin_token => 'keystone_admin_token', + :token_driver => 'keystone.token.backends.kvs.Token', + :token_format => 'PKI', :sql_connection => "mysql://keystone:keystone_pass@127.0.0.1/keystone" ) @@ -228,16 +237,20 @@ context 'when configuring swift' do before :each do params.merge!( - :swift => true, - :swift_user_password => 'foo', - :swift_public_address => '10.0.0.2' + :swift => true, + :swift_user_password => 'foo', + :swift_public_address => '10.0.0.2', + :swift_internal_address => '10.0.0.2', + :swift_admin_address => '10.0.0.2' ) end it 'should configure swift auth in keystone' do should contain_class('openstack::keystone').with( - :swift => true, - :swift_user_password => 'foo', - :swift_public_address => '10.0.0.2' + :swift => true, + :swift_user_password => 'foo', + :swift_public_address => '10.0.0.2', + :swift_internal_address => '10.0.0.2', + :swift_admin_address => '10.0.0.2' ) end end @@ -311,6 +324,15 @@ context 'when enabled' do it 'should contain enabled glance with defaults' do + should contain_class('openstack::glance').with( + :verbose => false, + :debug => false, + :registry_host => '0.0.0.0', + :enabled => true, + :use_syslog => false, + :log_facility => 'LOG_USER' + ) + should contain_class('glance::api').with( :verbose => false, :debug => false, @@ -370,11 +392,25 @@ :sql_idle_timeout => '30', :glance_db_user => 'dan', :glance_db_dbname => 'name', - :db_host => '127.0.0.2' + :glance_backend => 'rbd', + :glance_rbd_store_user => 'myuser', + :glance_rbd_store_pool => 'mypool', + :db_host => '127.0.0.2', + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' ) end it 'should override params for glance' do + should contain_class('openstack::glance').with( + :verbose => false, + :debug => false, + :registry_host => '127.0.0.2', + :enabled => true, + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + ) + should contain_class('glance::api').with( :verbose => false, :debug => false, @@ -402,6 +438,21 @@ ) end end + + context 'when the RBD backend is configured' do + let :params do + default_params.merge( + :glance_backend => 'rbd', + :glance_rbd_store_user => 'myuser', + :glance_rbd_store_pool => 'mypool' + ) + + should contain_class('glance::backend::rbd').with( + :rbd_store_user => 'myuser', + :rbd_store_pool => 'mypool' + ) + end + end end context 'config for nova' do @@ -420,6 +471,49 @@ context 'with default params' do it 'should contain enabled nova services' do + should contain_class('openstack::nova::controller').with( + :db_host => '127.0.0.1', + :sql_idle_timeout => '3600', + :network_manager => 'nova.network.manager.FlatDHCPManager', + :network_config => {}, + :floating_range => false, + :fixed_range => '10.0.0.0/24', + :public_address => '10.0.0.1', + :admin_address => false, + :internal_address => '127.0.0.1', + :auto_assign_floating_ip => false, + :create_networks => true, + :num_networks => 1, + :multi_host => false, + :public_interface => 'eth1', + :private_interface => 'eth0', + :quantum => false, + :quantum_user_password => false, + :metadata_shared_secret => false, + :security_group_api => 'quantum', + :nova_admin_tenant_name => 'services', + :nova_admin_user => 'nova', + :nova_user_password => 'nova_pass', + :nova_db_password => 'nova_pass', + :nova_db_user => 'nova', + :nova_db_dbname => 'nova', + :enabled_apis => 'ec2,osapi_compute,metadata', + :api_bind_address => '0.0.0.0', + :rabbit_user => 'openstack', + :rabbit_password => 'rabbit_pw', + :rabbit_hosts => false, + :rabbit_cluster_nodes => false, + :rabbit_virtual_host => '/', + :glance_api_servers => '', + :vnc_enabled => true, + :vncproxy_host => '10.0.0.1', + :use_syslog => false, + :log_facility => 'LOG_USER', + :debug => false, + :verbose => false, + :enabled => true + ) + should_not contain_resources('nova_config').with_purge(true) should contain_class('nova::rabbitmq').with( :userid => 'openstack', @@ -438,7 +532,8 @@ :image_service => 'nova.image.glance.GlanceImageService', :glance_api_servers => '10.0.0.1:9292', :debug => false, - :verbose => false + :verbose => false, + :memcached_servers => false ) should contain_class('nova::api').with( :enabled => true, @@ -446,6 +541,7 @@ :admin_user => 'nova', :admin_password => 'nova_pass', :enabled_apis => 'ec2,osapi_compute,metadata', + :auth_host => '127.0.0.1', :api_bind_address => '0.0.0.0' ) should contain_class('nova::cert').with(:enabled => true) @@ -483,10 +579,18 @@ context 'when params are overridden' do let :params do default_params.merge( - :sql_idle_timeout => '30' + :sql_idle_timeout => '30', + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' ) end it 'should override params for nova' do + should contain_class('openstack::nova::controller').with( + :sql_idle_timeout => '30', + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + ) + should contain_class('nova').with( :sql_idle_timeout => '30' ) @@ -501,7 +605,8 @@ :secret_key => 'secret_key', :cache_server_ip => '127.0.0.1', :cache_server_port => '11211', - :horizon_app_links => false + :horizon_app_links => false, + :keystone_host => '127.0.0.1' ) end @@ -557,10 +662,12 @@ :cinder_db_user => 'baz', :cinder_db_dbname => 'blah', :sql_idle_timeout => '30', - :db_host => '127.0.0.2' + :db_host => '127.0.0.2', + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' ) end - it 'should configure cinder using defaults' do + it 'should configure cinder using custom parameters' do should contain_class('cinder').with( :debug => true, :verbose => true, @@ -597,6 +704,8 @@ it { should_not contain_class('nova::network') } + it { should contain_class('nova::network::quantum').with(:security_group_api => 'quantum') } + it 'should configure quantum' do should contain_class('openstack::quantum').with( @@ -626,6 +735,8 @@ :keystone_host => '127.0.0.1', :enabled => true, :enable_server => true, + :use_syslog => false, + :log_facility => 'LOG_USER', :debug => true, :verbose => true ) diff --git a/spec/classes/openstack_glance_spec.rb b/spec/classes/openstack_glance_spec.rb index 0dd1163..415e6d5 100644 --- a/spec/classes/openstack_glance_spec.rb +++ b/spec/classes/openstack_glance_spec.rb @@ -32,6 +32,8 @@ :keystone_password => 'glance_user_pass', :sql_connection => 'mysql://glance:glance_db_pass@127.0.0.1/glance', :sql_idle_timeout => '3600', + :use_syslog => false, + :log_facility => 'LOG_USER', :enabled => true ) should contain_class('glance::registry').with( @@ -46,6 +48,8 @@ :keystone_password => 'glance_user_pass', :sql_connection => 'mysql://glance:glance_db_pass@127.0.0.1/glance', :sql_idle_timeout => '3600', + :use_syslog => false, + :log_facility => 'LOG_USER', :enabled => true ) should contain_class('glance::backend::file') @@ -135,4 +139,24 @@ end end + describe 'with custom syslog settings' do + before do + params.merge!({ + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + }) + end + + it 'should set parameters in included classes' do + should contain_class('glance::api').with( + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + ) + + should contain_class('glance::registry').with( + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + ) + end + end end diff --git a/spec/classes/openstack_keystone_spec.rb b/spec/classes/openstack_keystone_spec.rb index 064ca29..eb6ace1 100644 --- a/spec/classes/openstack_keystone_spec.rb +++ b/spec/classes/openstack_keystone_spec.rb @@ -37,8 +37,12 @@ :idle_timeout => '200', :catalog_type => 'sql', :admin_token => 'token', + :token_format => 'PKI', :enabled => true, - :sql_connection => 'mysql://keystone:pass@127.0.0.1/keystone' + :token_driver => 'keystone.token.backends.kvs.Token', + :sql_connection => 'mysql://keystone:pass@127.0.0.1/keystone', + :use_syslog => false, + :log_facility => 'LOG_USER' ) [ 'glance', 'cinder', 'quantum' ].each do |type| should contain_class("#{type}::keystone::auth").with( @@ -99,4 +103,20 @@ end end + describe 'with custom syslog settings' do + let :params do + required_params.merge( + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + ) + end + + it 'should set parameters in included classes' do + should contain_class('keystone').with( + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + ) + end + end + end diff --git a/spec/classes/openstack_nova_controller_spec.rb b/spec/classes/openstack_nova_controller_spec.rb index 3c08218..572eca0 100644 --- a/spec/classes/openstack_nova_controller_spec.rb +++ b/spec/classes/openstack_nova_controller_spec.rb @@ -48,7 +48,10 @@ :debug => false, :verbose => false, :rabbit_hosts => false, - :rabbit_host => '127.0.0.1' + :rabbit_host => '127.0.0.1', + :memcached_servers => false, + :use_syslog => false, + :log_facility => 'LOG_USER' ) should contain_class('nova::api').with( @@ -68,7 +71,8 @@ :quantum_url => "http://127.0.0.1:9696", :quantum_admin_tenant_name => 'services', :quantum_admin_username => 'quantum', - :quantum_admin_auth_url => "http://127.0.0.1:35357/v2.0" + :quantum_admin_auth_url => "http://127.0.0.1:35357/v2.0", + :security_group_api => 'quantum' ) ['nova::scheduler', 'nova::objectstore', 'nova::cert', 'nova::consoleauth', 'nova::conductor'].each do |x| @@ -94,4 +98,20 @@ ) end end + + context 'with custom syslog settings' do + let :params do + default_params.merge( + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + ) + end + it do + should contain_class('nova').with( + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + ) + end + end + end diff --git a/spec/classes/openstack_provision_spec.rb b/spec/classes/openstack_provision_spec.rb index 62a4fae..fe162af 100644 --- a/spec/classes/openstack_provision_spec.rb +++ b/spec/classes/openstack_provision_spec.rb @@ -38,4 +38,18 @@ end + describe 'should be possible to provision with quantum disabled' do + let :params do + { + :configure_tempest => true, + :quantum_available => false, + :tempest_repo_revision => 'stable/grizzly' + } + end + + it { should contain_class('tempest').with( + :tempest_repo_revision => 'stable/grizzly' + ) } + end + end diff --git a/spec/classes/openstack_quantum_spec.rb b/spec/classes/openstack_quantum_spec.rb index 33e0c21..321eb49 100644 --- a/spec/classes/openstack_quantum_spec.rb +++ b/spec/classes/openstack_quantum_spec.rb @@ -34,6 +34,8 @@ :rabbit_virtual_host => '/', :rabbit_user => 'rabbit_user', :rabbit_password => 'rabbit_pass', + :use_syslog => false, + :log_facility => 'LOG_USER', :verbose => false, :debug => false ) @@ -123,6 +125,19 @@ end end + context 'with custom syslog settings' do + before do + params.merge!( + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + ) + end + it { should contain_class('quantum').with( + :use_syslog => true, + :log_facility => 'LOG_LOCAL0' + ) } + end + context 'with invalid db_type' do before do params.merge!(:db_type => 'foo', :db_password => 'bar')