summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--manifests/haproxy.pp29
-rw-r--r--manifests/host/sriov.pp3
-rw-r--r--manifests/host/sriov/numvfs_persistence.pp23
-rw-r--r--manifests/profile/base/database/mysql.pp68
-rw-r--r--manifests/profile/base/docker_registry.pp73
-rw-r--r--manifests/profile/base/heat.pp2
-rw-r--r--manifests/profile/base/keystone.pp3
-rw-r--r--manifests/profile/base/nova.pp9
-rw-r--r--manifests/profile/base/nova/api.pp21
-rw-r--r--manifests/profile/base/nova/placement.pp98
-rw-r--r--manifests/profile/base/swift/proxy.pp4
-rw-r--r--manifests/profile/base/swift/storage.pp2
-rw-r--r--spec/classes/tripleo_profile_base_nova_api_spec.rb122
-rw-r--r--spec/classes/tripleo_profile_base_nova_compute_ironic_spec.rb67
-rw-r--r--spec/classes/tripleo_profile_base_nova_compute_libvirt_spec.rb69
-rw-r--r--spec/classes/tripleo_profile_base_nova_compute_spec.rb87
-rw-r--r--spec/classes/tripleo_profile_base_nova_conductor_spec.rb61
-rw-r--r--spec/classes/tripleo_profile_base_nova_consoleauth_spec.rb62
-rw-r--r--spec/classes/tripleo_profile_base_nova_libvirt_spec.rb68
-rw-r--r--spec/classes/tripleo_profile_base_nova_scheduler_spec.rb64
-rw-r--r--spec/classes/tripleo_profile_base_nova_spec.rb131
-rw-r--r--spec/classes/tripleo_profile_base_nova_vncproxy_spec.rb62
-rw-r--r--spec/defines/tripleo_host_sriov_numvfs_persistence_spec.rb11
-rw-r--r--spec/fixtures/hieradata/default.yaml9
-rw-r--r--templates/docker_distribution/registry_config.yml.erb11
25 files changed, 1087 insertions, 72 deletions
diff --git a/manifests/haproxy.pp b/manifests/haproxy.pp
index 1e76733..cc21e37 100644
--- a/manifests/haproxy.pp
+++ b/manifests/haproxy.pp
@@ -167,6 +167,10 @@
# (optional) Enable or not Nova API binding
# Defaults to hiera('nova_api_enabled', false)
#
+# [*nova_placement*]
+# (optional) Enable or not Nova Placement API binding
+# Defaults to hiera('nova_placement_enabled', false)
+#
# [*nova_metadata*]
# (optional) Enable or not Nova metadata binding
# Defaults to hiera('nova_api_enabled', false)
@@ -444,6 +448,8 @@
# 'neutron_api_ssl_port' (Defaults to 13696)
# 'nova_api_port' (Defaults to 8774)
# 'nova_api_ssl_port' (Defaults to 13774)
+# 'nova_placement_port' (Defaults to 8778)
+# 'nova_placement_ssl_port' (Defaults to 13778)
# 'nova_metadata_port' (Defaults to 8775)
# 'nova_novnc_port' (Defaults to 6080)
# 'nova_novnc_ssl_port' (Defaults to 13080)
@@ -500,6 +506,7 @@ class tripleo::haproxy (
$glance_api = hiera('glance_api_enabled', false),
$glance_registry = hiera('glance_registry_enabled', false),
$nova_osapi = hiera('nova_api_enabled', false),
+ $nova_placement = hiera('nova_placement_enabled', false),
$nova_metadata = hiera('nova_api_enabled', false),
$nova_novncproxy = hiera('nova_vnc_proxy_enabled', false),
$ceilometer = hiera('ceilometer_api_enabled', false),
@@ -598,6 +605,8 @@ class tripleo::haproxy (
neutron_api_ssl_port => 13696,
nova_api_port => 8774,
nova_api_ssl_port => 13774,
+ nova_placement_port => 8778,
+ nova_placement_ssl_port => 13778,
nova_metadata_port => 8775,
nova_novnc_port => 6080,
nova_novnc_ssl_port => 13080,
@@ -928,6 +937,26 @@ class tripleo::haproxy (
}
}
+ $nova_placement_vip = hiera('nova_placement_vip', $controller_virtual_ip)
+ if $nova_placement {
+ ::tripleo::haproxy::endpoint { 'nova_placement':
+ public_virtual_ip => $public_virtual_ip,
+ internal_ip => $nova_placement_vip,
+ service_port => $ports[nova_placement_port],
+ ip_addresses => hiera('nova_placement_node_ips', $controller_hosts_real),
+ server_names => hiera('nova_placement_node_names', $controller_hosts_names_real),
+ mode => 'http',
+ listen_options => {
+ 'http-request' => [
+ 'set-header X-Forwarded-Proto https if { ssl_fc }',
+ 'set-header X-Forwarded-Proto http if !{ ssl_fc }'],
+ },
+ public_ssl_port => $ports[nova_placement_ssl_port],
+ service_network => $nova_osapi_network,
+ member_options => union($haproxy_member_options, $internal_tls_member_options),
+ }
+ }
+
if $nova_metadata {
::tripleo::haproxy::endpoint { 'nova_metadata':
internal_ip => hiera('nova_metadata_vip', $controller_virtual_ip),
diff --git a/manifests/host/sriov.pp b/manifests/host/sriov.pp
index a30db42..b94c472 100644
--- a/manifests/host/sriov.pp
+++ b/manifests/host/sriov.pp
@@ -21,7 +21,8 @@ class tripleo::host::sriov (
# the numvfs configuration needs to be persisted for every boot
tripleo::host::sriov::numvfs_persistence {'persistent_numvfs':
vf_defs => $number_of_vfs,
- content_string => "#!/bin/bash\n"
+ content_string => "#!/bin/bash\n",
+ udev_rules => ''
}
}
}
diff --git a/manifests/host/sriov/numvfs_persistence.pp b/manifests/host/sriov/numvfs_persistence.pp
index 1ee402c..ec8c875 100644
--- a/manifests/host/sriov/numvfs_persistence.pp
+++ b/manifests/host/sriov/numvfs_persistence.pp
@@ -10,9 +10,16 @@
# [*content_string*]
# (required) String which shall be written to the script file.
#
+# [*udev_rules*]
+# (required) String of lines to write to udev rules to ensure
+# VFs are reconfigured if the PCI devices are removed and
+# readded without rebooting (e.g. when physical functions were
+# allocated to VMs)
+#
define tripleo::host::sriov::numvfs_persistence(
$vf_defs,
- $content_string
+ $content_string,
+ $udev_rules
){
# Since reduce isn't available, we use recursion to iterate each entries of
# "physical_interface:vfs" and accumulate the content that needs to be
@@ -36,6 +43,16 @@ define tripleo::host::sriov::numvfs_persistence(
replace => false
}
+ file { '/etc/udev/rules.d/70-tripleo-reset-sriov.rules':
+ ensure => file,
+ group => 'root',
+ mode => '0755',
+ owner => 'root',
+ content => $udev_rules,
+ replace => true,
+ }
+
+
file_line { 'call_ifup-local':
path => '/sbin/ifup-local',
line => '/etc/sysconfig/allocate_vfs $1',
@@ -46,9 +63,11 @@ define tripleo::host::sriov::numvfs_persistence(
$interface = $vfspec[0]
$count = $vfspec[1]
$vfdef_str = "${content_string}[ \"${interface}\" == \"\$1\" ] && echo ${count} > /sys/class/net/${interface}/device/sriov_numvfs\n"
+ $udev_str = "${udev_rules}KERNEL==\"${interface}\", RUN+=\"/etc/sysconfig/allocate_vfs %k\"\n"
tripleo::host::sriov::numvfs_persistence{"mapped ${interface}":
vf_defs => delete_at($vf_defs, 0),
- content_string => $vfdef_str
+ content_string => $vfdef_str,
+ udev_rules => $udev_str
}
}
}
diff --git a/manifests/profile/base/database/mysql.pp b/manifests/profile/base/database/mysql.pp
index 54f6574..1692108 100644
--- a/manifests/profile/base/database/mysql.pp
+++ b/manifests/profile/base/database/mysql.pp
@@ -66,37 +66,6 @@
# for more details.
# Defaults to hiera('step')
#
-# [*nova_messaging_driver*]
-# Driver for messaging service. Will fallback to looking up in hiera
-# using hiera('messaging_service_name', 'rabbit') if the parameter is not
-# specified.
-# Defaults to undef.
-#
-# [*nova_messaging_hosts*]
-# list of the messaging host fqdns. Will fallback to looking up in hiera
-# using hiera('rabbitmq_node_names') if the parameter is not specified.
-# Defaults to undef.
-#
-# [*nova_messaging_port*]
-# IP port for messaging service. Will fallback to looking up in hiera using
-# hiera('nova::rabbit_port', 5672) if the parameter is not specified.
-# Defaults to undef.
-#
-# [*nova_messaging_username*]
-# Username for messaging nova queue. Will fallback to looking up in hiera
-# using hiera('nova::rabbit_userid', 'guest') if the parameter is not
-# specified.
-# Defaults to undef.
-#
-# [*nova_messaging_password*]
-# Password for messaging nova queue. Will fallback to looking up in hiera
-# using hiera('nova::rabbit_password') if the parameter is not specified.
-# Defaults to undef.
-#
-# [*nova_messaging_use_ssl*]
-# Flag indicating ssl usage. Will fallback to looking up in hiera using
-# hiera('nova::rabbit_use_ssl', '0') if the parameter is not specified.
-# Defaults to undef.
#
class tripleo::profile::base::database::mysql (
$bind_address = $::hostname,
@@ -108,12 +77,6 @@ class tripleo::profile::base::database::mysql (
$mysql_server_options = {},
$remove_default_accounts = true,
$step = hiera('step'),
- $nova_messaging_driver = undef,
- $nova_messaging_hosts = undef,
- $nova_messaging_password = undef,
- $nova_messaging_port = undef,
- $nova_messaging_username = undef,
- $nova_messaging_use_ssl = undef,
) {
if $::hostname == downcase($bootstrap_node) {
@@ -214,35 +177,10 @@ class tripleo::profile::base::database::mysql (
}
if hiera('nova_api_enabled', false) {
include ::nova::db::mysql
- # NOTE(aschultz): I am generally opposed to this, however given that the
- # nova api is optional, we need to do this lookups only if not provided
- # via parameters.
- $messaging_driver_real = pick($nova_messaging_driver,
- hiera('messaging_service_name', 'rabbit'))
- $messaging_hosts_real = any2array(
- pick($nova_messaging_hosts, hiera('rabbitmq_node_names')))
- # TODO(aschultz): remove sprintf once we properly type the port, needs
- # to be a string for the os_transport_url function.
- $messaging_port_real = sprintf('%s',
- pick($nova_messaging_port, hiera('nova::rabbit_port', '5672')))
- $messaging_username_real = pick($nova_messaging_username,
- hiera('nova::rabbit_userid', 'guest'))
- $messaging_password_real = pick($nova_messaging_password,
- hiera('nova::rabbit_password'))
- $messaging_use_ssl_real = sprintf('%s', bool2num(str2bool(
- pick($nova_messaging_use_ssl, hiera('nova::rabbit_user_ssl', '0')))))
-
include ::nova::db::mysql_api
- class { '::nova::db::sync_cell_v2':
- transport_url => os_transport_url({
- 'transport' => $messaging_driver_real,
- 'hosts' => $messaging_hosts_real,
- 'port' => $messaging_port_real,
- 'username' => $messaging_username_real,
- 'password' => $messaging_password_real,
- 'ssl' => $messaging_use_ssl_real,
- }),
- }
+ }
+ if hiera('nova_placement_enabled', false) {
+ include ::nova::db::mysql_placement
}
if hiera('sahara_api_enabled', false) {
include ::sahara::db::mysql
diff --git a/manifests/profile/base/docker_registry.pp b/manifests/profile/base/docker_registry.pp
new file mode 100644
index 0000000..05a516d
--- /dev/null
+++ b/manifests/profile/base/docker_registry.pp
@@ -0,0 +1,73 @@
+# Copyright 2017 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# == Class: tripleo::profile::base::docker_registry
+#
+# Docker Registry profile for tripleo
+#
+# === Parameters:
+#
+# [*registry_host*]
+# (String) IP address on which the Docker registry is listening on
+# Defaults to hiera('controller_host')
+#
+# [*registry_port*]
+# (Integer) The port on which the Docker registry is listening on
+# Defaults to 8787
+#
+# [*controller_admin_vip*]
+# (String) VIP of the host
+# Defaults to hiera('controller_admin_vip')
+#
+class tripleo::profile::base::docker_registry (
+ $registry_host = hiera('controller_host'),
+ $registry_port = 8787,
+ $controller_admin_vip = hiera('controller_admin_vip'),
+) {
+ # We want a v2 registry
+ package{'docker-registry':
+ ensure => absent,
+ }
+ package{'docker-distribution': }
+ package{'docker': }
+ file { '/etc/docker-distribution/registry/config.yml' :
+ ensure => file,
+ content => template('tripleo/docker_distribution/registry_config.yml.erb'),
+ owner => 'root',
+ group => 'root',
+ mode => '0644',
+ require => Package['docker-distribution'],
+ notify => Service['docker-distribution'],
+ }
+ file_line { 'docker insecure registry':
+ path => '/etc/sysconfig/docker',
+ line => join ([
+ 'INSECURE_REGISTRY="',
+ '--insecure-registry ', $registry_host, ':', $registry_port, ' ',
+ '--insecure-registry ', $controller_admin_vip, ':', $registry_port, '"']),
+ match => 'INSECURE_REGISTRY=',
+ require => Package['docker'],
+ notify => Service['docker'],
+ }
+ service { 'docker-distribution':
+ ensure => running,
+ enable => true,
+ require => Package['docker-distribution'],
+ }
+ service { 'docker':
+ ensure => running,
+ enable => true,
+ require => Package['docker'],
+ }
+}
diff --git a/manifests/profile/base/heat.pp b/manifests/profile/base/heat.pp
index c743ce0..6e7e5f6 100644
--- a/manifests/profile/base/heat.pp
+++ b/manifests/profile/base/heat.pp
@@ -59,9 +59,7 @@ class tripleo::profile::base::heat (
manage_user => false,
manage_role => false,
}
- }
- if $step >= 4 {
$rabbit_endpoints = suffix(any2array($rabbit_hosts), ":${rabbit_port}")
class { '::heat' :
notification_driver => $notification_driver,
diff --git a/manifests/profile/base/keystone.pp b/manifests/profile/base/keystone.pp
index 26e7b1f..a388def 100644
--- a/manifests/profile/base/keystone.pp
+++ b/manifests/profile/base/keystone.pp
@@ -236,6 +236,9 @@ class tripleo::profile::base::keystone (
if hiera('nova_api_enabled', false) {
include ::nova::keystone::auth
}
+ if hiera('nova_placement_enabled', false) {
+ include ::nova::keystone::auth_placement
+ }
if hiera('panko_api_enabled', false) {
include ::panko::keystone::auth
}
diff --git a/manifests/profile/base/nova.pp b/manifests/profile/base/nova.pp
index ab9700f..dae627c 100644
--- a/manifests/profile/base/nova.pp
+++ b/manifests/profile/base/nova.pp
@@ -50,6 +50,10 @@
# Username for messaging nova queue
# Defaults to hiera('nova::rabbit_userid', 'guest')
#
+# [*messaging_use_ssl*]
+# Flag indicating ssl usage.
+# Defaults to hiera('nova::rabbit_use_ssl', '0')
+#
# [*nova_compute_enabled*]
# (Optional) Whether or not nova-compute is enabled.
# Defaults to false
@@ -67,6 +71,7 @@ class tripleo::profile::base::nova (
$messaging_password = hiera('nova::rabbit_password'),
$messaging_port = hiera('nova::rabbit_port', '5672'),
$messaging_username = hiera('nova::rabbit_userid', 'guest'),
+ $messaging_use_ssl = hiera('nova::rabbit_use_ssl', '0'),
$nova_compute_enabled = false,
$step = hiera('step'),
) {
@@ -82,7 +87,8 @@ class tripleo::profile::base::nova (
$memcache_servers = suffix(hiera('memcached_node_ips'), ':11211')
}
- if hiera('step') >= 4 or (hiera('step') >= 3 and $sync_db) {
+ if $step >= 4 or ($step >= 3 and $sync_db) {
+ $messaging_use_ssl_real = sprintf('%s', bool2num(str2bool($messaging_use_ssl)))
# TODO(ccamacho): remove sprintf once we properly type the port, needs
# to be a string for the os_transport_url function.
class { '::nova' :
@@ -92,6 +98,7 @@ class tripleo::profile::base::nova (
'port' => sprintf('%s', $messaging_port),
'username' => $messaging_username,
'password' => $messaging_password,
+ 'ssl' => $messaging_use_ssl_real,
}),
}
include ::nova::config
diff --git a/manifests/profile/base/nova/api.pp b/manifests/profile/base/nova/api.pp
index 69b90fa..8ded3ef 100644
--- a/manifests/profile/base/nova/api.pp
+++ b/manifests/profile/base/nova/api.pp
@@ -85,6 +85,27 @@ class tripleo::profile::base::nova::api (
$tls_keyfile = undef
}
+ if ($step >= 3 and $sync_db) {
+ $messaging_hosts_real = any2array($::tripleo::profile::base::nova::messaging_hosts)
+ # TODO(aschultz): remove sprintf once we properly type the port, needs
+ # to be a string for the os_transport_url function.
+ $messaging_port_real = sprintf('%s', $::tripleo::profile::base::nova::messaging_port)
+ $messaging_use_ssl_real = sprintf('%s', bool2num(str2bool($::tripleo::profile::base::nova::messaging_use_ssl)))
+
+ #TODO(emilien): enable it again when it's fixed upstream in nova
+ # https://bugs.launchpad.net/tripleo/+bug/1649341
+ # class { '::nova::db::sync_cell_v2':
+ # transport_url => os_transport_url({
+ # 'transport' => $::tripleo::profile::base::nova::messaging_driver,
+ # 'hosts' => $messaging_hosts_real,
+ # 'port' => $messaging_port_real,
+ # 'username' => $::tripleo::profile::base::nova::messaging_username,
+ # 'password' => $::tripleo::profile::base::nova::messaging_password,
+ # 'ssl' => $messaging_use_ssl_real,
+ # }),
+ # }
+ }
+
if $step >= 4 or ($step >= 3 and $sync_db) {
if hiera('nova::use_ipv6', false) {
diff --git a/manifests/profile/base/nova/placement.pp b/manifests/profile/base/nova/placement.pp
new file mode 100644
index 0000000..7edd4e8
--- /dev/null
+++ b/manifests/profile/base/nova/placement.pp
@@ -0,0 +1,98 @@
+# Copyright 2016 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+# == Class: tripleo::profile::base::nova::placement
+#
+# Nova Placement API profile for tripleo
+#
+# [*bootstrap_node*]
+# (Optional) The hostname of the node responsible for bootstrapping tasks
+# Defaults to hiera('bootstrap_nodeid')
+#
+# [*certificates_specs*]
+# (Optional) The specifications to give to certmonger for the certificate(s)
+# it will create.
+# Example with hiera:
+# apache_certificates_specs:
+# httpd-internal_api:
+# hostname: <overcloud controller fqdn>
+# service_certificate: <service certificate path>
+# service_key: <service key path>
+# principal: "haproxy/<overcloud controller fqdn>"
+# Defaults to hiera('apache_certificate_specs', {}).
+#
+# [*enable_internal_tls*]
+# (Optional) Whether TLS in the internal network is enabled or not.
+# Defaults to hiera('enable_internal_tls', false)
+#
+# [*generate_service_certificates*]
+# (Optional) Whether or not certmonger will generate certificates for
+# HAProxy. This could be as many as specified by the $certificates_specs
+# variable.
+# Note that this doesn't configure the certificates in haproxy, it merely
+# creates the certificates.
+# Defaults to hiera('generate_service_certificate', false).
+#
+# [*nova_placement_network*]
+# (Optional) The network name where the nova placement endpoint is listening on.
+# This is set by t-h-t.
+# Defaults to hiera('nova_placement_network', undef)
+#
+# [*step*]
+# (Optional) The current step in deployment. See tripleo-heat-templates
+# for more details.
+# Defaults to hiera('step')
+#
+class tripleo::profile::base::nova::placement (
+ $bootstrap_node = hiera('bootstrap_nodeid', undef),
+ $certificates_specs = hiera('apache_certificates_specs', {}),
+ $enable_internal_tls = hiera('enable_internal_tls', false),
+ $generate_service_certificates = hiera('generate_service_certificates', false),
+ $nova_placement_network = hiera('nova_placement_network', undef),
+ $step = hiera('step'),
+) {
+ if $::hostname == downcase($bootstrap_node) {
+ $sync_db = true
+ } else {
+ $sync_db = false
+ }
+
+ include ::tripleo::profile::base::nova
+
+ if $enable_internal_tls {
+ if $generate_service_certificates {
+ ensure_resources('tripleo::certmonger::httpd', $certificates_specs)
+ }
+
+ if !$nova_placement_network {
+ fail('nova_placement_network is not set in the hieradata.')
+ }
+ $tls_certfile = $certificates_specs["httpd-${nova_placement_network}"]['service_certificate']
+ $tls_keyfile = $certificates_specs["httpd-${nova_placement_network}"]['service_key']
+ } else {
+ $tls_certfile = undef
+ $tls_keyfile = undef
+ }
+
+ if $step >= 4 {
+ include ::nova::placement
+
+ class { '::nova::wsgi::apache_placement':
+ ssl_cert => $tls_certfile,
+ ssl_key => $tls_keyfile,
+ }
+ }
+
+}
+
diff --git a/manifests/profile/base/swift/proxy.pp b/manifests/profile/base/swift/proxy.pp
index 7bbef1e..5bd75bd 100644
--- a/manifests/profile/base/swift/proxy.pp
+++ b/manifests/profile/base/swift/proxy.pp
@@ -80,5 +80,9 @@ class tripleo::profile::base::swift::proxy (
include ::swift::proxy::copy
include ::swift::proxy::container_quotas
include ::swift::proxy::account_quotas
+
+ class { '::swift::objectexpirer':
+ memcache_servers => $swift_memcache_servers
+ }
}
}
diff --git a/manifests/profile/base/swift/storage.pp b/manifests/profile/base/swift/storage.pp
index 568be66..5018d77 100644
--- a/manifests/profile/base/swift/storage.pp
+++ b/manifests/profile/base/swift/storage.pp
@@ -34,8 +34,10 @@ class tripleo::profile::base::swift::storage (
) {
if $step >= 4 {
if $enable_swift_storage {
+ include ::swift
include ::swift::config
include ::swift::storage::disks
+ include ::swift::storage::loopbacks
include ::swift::storage::all
if(!defined(File['/srv/node'])) {
file { '/srv/node':
diff --git a/spec/classes/tripleo_profile_base_nova_api_spec.rb b/spec/classes/tripleo_profile_base_nova_api_spec.rb
new file mode 100644
index 0000000..4aa7367
--- /dev/null
+++ b/spec/classes/tripleo_profile_base_nova_api_spec.rb
@@ -0,0 +1,122 @@
+#
+# Copyright (C) 2017 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+require 'spec_helper'
+
+describe 'tripleo::profile::base::nova::api' do
+ shared_examples_for 'tripleo::profile::base::nova::api' do
+ let(:pre_condition) do
+ <<-eos
+ class { '::tripleo::profile::base::nova':
+ step => #{params[:step]},
+ messaging_hosts => [ 'localhost' ],
+ messaging_username => 'nova',
+ messaging_password => 'foo'
+ }
+eos
+ end
+
+ context 'with step less than 3' do
+ let(:params) { {
+ :step => 1,
+ } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::api')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to_not contain_class('nova::keystone::authtoken')
+ is_expected.to_not contain_class('nova::api')
+ is_expected.to_not contain_class('nova::wsgi::apache_api')
+ is_expected.to_not contain_class('nova::network::neutron')
+ }
+ end
+
+ context 'with step 3 on bootstrap node' do
+ let(:params) { {
+ :step => 3,
+ :bootstrap_node => 'node.example.com',
+ } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::api')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ #TODO(emilien): enable it again when it's fixed upstream in nova
+ # https://bugs.launchpad.net/tripleo/+bug/1649341
+ # is_expected.to contain_class('nova::db::sync_cell_v2').with(
+ # :transport_url => 'rabbit://nova:foo@localhost:5672/?ssl=0')
+ # is_expected.to contain_class('nova::keystone::authtoken')
+ is_expected.to contain_class('nova::api')
+ is_expected.to contain_class('nova::wsgi::apache_api')
+ is_expected.to contain_class('nova::network::neutron')
+ }
+ end
+
+ context 'with step 3 not on bootstrap node' do
+ let(:params) { {
+ :step => 3,
+ :bootstrap_node => 'other.example.com',
+ } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::api')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to_not contain_class('nova::db::sync_cell_v2')
+ is_expected.to_not contain_class('nova::keystone::authtoken')
+ is_expected.to_not contain_class('nova::api')
+ is_expected.to_not contain_class('nova::wsgi::apache_api')
+ is_expected.to_not contain_class('nova::network::neutron')
+ }
+ end
+
+ context 'with step 4 not on bootstrap node' do
+ let(:params) { {
+ :step => 4,
+ :bootstrap_node => 'other.example.com',
+ } }
+
+ it {
+ is_expected.to_not contain_class('nova::db::sync_cell_v2')
+ is_expected.to contain_class('nova::keystone::authtoken')
+ is_expected.to contain_class('nova::api')
+ is_expected.to contain_class('nova::wsgi::apache_api')
+ is_expected.to contain_class('nova::network::neutron')
+ }
+ end
+
+ context 'with step 5' do
+ let(:params) { {
+ :step => 5,
+ :bootstrap_node => 'other.example.com',
+ } }
+
+ it {
+ is_expected.to contain_class('nova::cron::archive_deleted_rows')
+ }
+ end
+
+ end
+
+
+ on_supported_os.each do |os, facts|
+ context "on #{os}" do
+ let(:facts) do
+ facts.merge({ :hostname => 'node.example.com' })
+ end
+
+ it_behaves_like 'tripleo::profile::base::nova::api'
+ end
+ end
+end
diff --git a/spec/classes/tripleo_profile_base_nova_compute_ironic_spec.rb b/spec/classes/tripleo_profile_base_nova_compute_ironic_spec.rb
new file mode 100644
index 0000000..2155695
--- /dev/null
+++ b/spec/classes/tripleo_profile_base_nova_compute_ironic_spec.rb
@@ -0,0 +1,67 @@
+#
+# Copyright (C) 2017 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+require 'spec_helper'
+
+describe 'tripleo::profile::base::nova::compute::ironic' do
+ shared_examples_for 'tripleo::profile::base::nova::compute::ironic' do
+
+ context 'with step less than 4' do
+ let(:params) { { :step => 1, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::compute::ironic')
+ is_expected.to_not contain_class('tripleo::profile::base::nova')
+ is_expected.to_not contain_class('nova::compute::ironic')
+ is_expected.to_not contain_class('nova::network::neutron')
+ }
+ end
+
+ context 'with step 4' do
+ let(:pre_condition) do
+ <<-eos
+ class { '::tripleo::profile::base::nova':
+ step => #{params[:step]},
+ messaging_hosts => [ '127.0.0.1' ],
+ }
+ class { '::tripleo::profile::base::nova::compute':
+ step => #{params[:step]},
+ }
+eos
+ end
+
+ let(:params) { { :step => 4, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::compute::ironic')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('nova::compute::ironic')
+ is_expected.to contain_class('nova::network::neutron')
+ }
+ end
+ end
+
+
+ on_supported_os.each do |os, facts|
+ context "on #{os}" do
+ let(:facts) do
+ facts.merge({ :hostname => 'node.example.com' })
+ end
+
+ it_behaves_like 'tripleo::profile::base::nova::compute::ironic'
+ end
+ end
+end
diff --git a/spec/classes/tripleo_profile_base_nova_compute_libvirt_spec.rb b/spec/classes/tripleo_profile_base_nova_compute_libvirt_spec.rb
new file mode 100644
index 0000000..0b33123
--- /dev/null
+++ b/spec/classes/tripleo_profile_base_nova_compute_libvirt_spec.rb
@@ -0,0 +1,69 @@
+#
+# Copyright (C) 2017 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+require 'spec_helper'
+
+describe 'tripleo::profile::base::nova::compute::libvirt' do
+ shared_examples_for 'tripleo::profile::base::nova::compute::libvirt' do
+
+ context 'with step less than 4' do
+ let(:params) { { :step => 1, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::compute::libvirt')
+ is_expected.to_not contain_class('tripleo::profile::base::nova')
+ is_expected.to_not contain_class('tripleo::profile::base::nova::compute')
+ is_expected.to_not contain_class('nova::compute::libvirt')
+ is_expected.to_not contain_class('nova::compute::libvirt::qemu')
+ }
+ end
+
+ context 'with step 4' do
+ let(:pre_condition) do
+ <<-eos
+ class { '::tripleo::profile::base::nova':
+ step => #{params[:step]},
+ messaging_hosts => [ '127.0.0.1' ],
+ }
+ class { '::tripleo::profile::base::nova::compute':
+ step => #{params[:step]},
+ }
+eos
+ end
+
+ let(:params) { { :step => 4, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::compute::libvirt')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('tripleo::profile::base::nova::compute')
+ is_expected.to contain_class('nova::compute::libvirt')
+ is_expected.to contain_class('nova::compute::libvirt::qemu')
+ }
+ end
+ end
+
+
+ on_supported_os.each do |os, facts|
+ context "on #{os}" do
+ let(:facts) do
+ facts.merge({ :hostname => 'node.example.com' })
+ end
+
+ it_behaves_like 'tripleo::profile::base::nova::compute::libvirt'
+ end
+ end
+end
diff --git a/spec/classes/tripleo_profile_base_nova_compute_spec.rb b/spec/classes/tripleo_profile_base_nova_compute_spec.rb
new file mode 100644
index 0000000..a0b2387
--- /dev/null
+++ b/spec/classes/tripleo_profile_base_nova_compute_spec.rb
@@ -0,0 +1,87 @@
+#
+# Copyright (C) 2017 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+require 'spec_helper'
+
+describe 'tripleo::profile::base::nova::compute' do
+ shared_examples_for 'tripleo::profile::base::nova::compute' do
+
+ context 'with step less than 4' do
+ let(:params) { { :step => 1, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::compute')
+ is_expected.to_not contain_class('tripleo::profile::base::nova')
+ is_expected.to_not contain_class('nova::compute')
+ is_expected.to_not contain_class('nova::network::neutron')
+ is_expected.to_not contain_exec('reset-iscsi-initiator-name')
+ is_expected.to_not contain_file('/etc/iscsi/.initiator_reset')
+ }
+ end
+
+ context 'with step 4' do
+ let(:pre_condition) do
+ <<-eos
+ class { '::tripleo::profile::base::nova':
+ step => #{params[:step]},
+ messaging_hosts => [ '127.0.0.1' ],
+ }
+eos
+ end
+
+ context 'default params' do
+ let(:params) { { :step => 4, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::compute')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('nova::compute')
+ is_expected.to contain_class('nova::network::neutron')
+ is_expected.to contain_exec('reset-iscsi-initiator-name')
+ is_expected.to contain_file('/etc/iscsi/.initiator_reset')
+ is_expected.to_not contain_package('nfs-utils')
+ }
+ end
+
+ context 'cinder nfs backend' do
+ let(:params) { { :step => 4, :cinder_nfs_backend => true } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::compute')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('nova::compute')
+ is_expected.to contain_class('nova::network::neutron')
+ is_expected.to contain_exec('reset-iscsi-initiator-name')
+ is_expected.to contain_file('/etc/iscsi/.initiator_reset')
+ is_expected.to contain_package('nfs-utils')
+ }
+ end
+ end
+ end
+
+
+ on_supported_os.each do |os, facts|
+ context "on #{os}" do
+ let(:facts) do
+ facts.merge({ :hostname => 'node.example.com' })
+ end
+
+ it_behaves_like 'tripleo::profile::base::nova::compute'
+ end
+ end
+end
diff --git a/spec/classes/tripleo_profile_base_nova_conductor_spec.rb b/spec/classes/tripleo_profile_base_nova_conductor_spec.rb
new file mode 100644
index 0000000..8cdf8b0
--- /dev/null
+++ b/spec/classes/tripleo_profile_base_nova_conductor_spec.rb
@@ -0,0 +1,61 @@
+#
+# Copyright (C) 2017 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+require 'spec_helper'
+
+describe 'tripleo::profile::base::nova::conductor' do
+ shared_examples_for 'tripleo::profile::base::nova::conductor' do
+ let(:pre_condition) do
+ <<-eos
+ class { '::tripleo::profile::base::nova':
+ step => #{params[:step]},
+ messaging_hosts => [ '127.0.0.1' ],
+ }
+eos
+ end
+
+ context 'with step less than 4' do
+ let(:params) { { :step => 1, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::conductor')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to_not contain_class('nova::conductor')
+ }
+ end
+
+ context 'with step 4' do
+ let(:params) { { :step => 4, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::conductor')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('nova::conductor')
+ }
+ end
+ end
+
+
+ on_supported_os.each do |os, facts|
+ context "on #{os}" do
+ let(:facts) do
+ facts.merge({ :hostname => 'node.example.com' })
+ end
+
+ it_behaves_like 'tripleo::profile::base::nova::conductor'
+ end
+ end
+end
diff --git a/spec/classes/tripleo_profile_base_nova_consoleauth_spec.rb b/spec/classes/tripleo_profile_base_nova_consoleauth_spec.rb
new file mode 100644
index 0000000..e8a2dff
--- /dev/null
+++ b/spec/classes/tripleo_profile_base_nova_consoleauth_spec.rb
@@ -0,0 +1,62 @@
+#
+# Copyright (C) 2017 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+require 'spec_helper'
+
+describe 'tripleo::profile::base::nova::consoleauth' do
+ shared_examples_for 'tripleo::profile::base::nova::consoleauth' do
+
+ context 'with step less than 4' do
+ let(:params) { { :step => 1, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::consoleauth')
+ is_expected.to_not contain_class('tripleo::profile::base::nova')
+ is_expected.to_not contain_class('nova::consoleauth')
+ }
+ end
+
+ context 'with step 4' do
+ let(:pre_condition) do
+ <<-eos
+ class { '::tripleo::profile::base::nova':
+ step => #{params[:step]},
+ messaging_hosts => [ '127.0.0.1' ],
+ }
+eos
+ end
+
+ let(:params) { { :step => 4, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::consoleauth')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('nova::consoleauth')
+ }
+ end
+ end
+
+
+ on_supported_os.each do |os, facts|
+ context "on #{os}" do
+ let(:facts) do
+ facts.merge({ :hostname => 'node.example.com' })
+ end
+
+ it_behaves_like 'tripleo::profile::base::nova::consoleauth'
+ end
+ end
+end
diff --git a/spec/classes/tripleo_profile_base_nova_libvirt_spec.rb b/spec/classes/tripleo_profile_base_nova_libvirt_spec.rb
new file mode 100644
index 0000000..d263a74
--- /dev/null
+++ b/spec/classes/tripleo_profile_base_nova_libvirt_spec.rb
@@ -0,0 +1,68 @@
+#
+# Copyright (C) 2017 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+require 'spec_helper'
+
+describe 'tripleo::profile::base::nova::libvirt' do
+ shared_examples_for 'tripleo::profile::base::nova::libvirt' do
+
+ context 'with step less than 4' do
+ let(:params) { { :step => 1, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::libvirt')
+ is_expected.to_not contain_class('tripleo::profile::base::nova')
+ is_expected.to_not contain_class('nova::compute::libvirt::services')
+ is_expected.to_not contain_file('/etclibvirt/qemu/networks/autostart/default.xml')
+ is_expected.to_not contain_file('/etclibvirt/qemu/networks/default.xml')
+ is_expected.to_not contain_exec('libvirt-default-net-destroy')
+ }
+ end
+
+ context 'with step 4' do
+ let(:pre_condition) do
+ <<-eos
+ class { '::tripleo::profile::base::nova':
+ step => #{params[:step]},
+ messaging_hosts => [ '127.0.0.1' ],
+ }
+eos
+ end
+
+ let(:params) { { :step => 4, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::libvirt')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('nova::compute::libvirt::services')
+ is_expected.to contain_file('/etc/libvirt/qemu/networks/autostart/default.xml').with_ensure('absent')
+ is_expected.to contain_file('/etc/libvirt/qemu/networks/default.xml').with_ensure('absent')
+ is_expected.to contain_exec('libvirt-default-net-destroy')
+ }
+ end
+ end
+
+
+ on_supported_os.each do |os, facts|
+ context "on #{os}" do
+ let(:facts) do
+ facts.merge({ :hostname => 'node.example.com' })
+ end
+
+ it_behaves_like 'tripleo::profile::base::nova::libvirt'
+ end
+ end
+end
diff --git a/spec/classes/tripleo_profile_base_nova_scheduler_spec.rb b/spec/classes/tripleo_profile_base_nova_scheduler_spec.rb
new file mode 100644
index 0000000..87783c1
--- /dev/null
+++ b/spec/classes/tripleo_profile_base_nova_scheduler_spec.rb
@@ -0,0 +1,64 @@
+#
+# Copyright (C) 2017 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+require 'spec_helper'
+
+describe 'tripleo::profile::base::nova::scheduler' do
+ shared_examples_for 'tripleo::profile::base::nova::scheduler' do
+
+ context 'with step less than 4' do
+ let(:params) { { :step => 1, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::scheduler')
+ is_expected.to_not contain_class('tripleo::profile::base::nova')
+ is_expected.to_not contain_class('nova::scheduler')
+ is_expected.to_not contain_class('nova::scheduler::filter')
+ }
+ end
+
+ context 'with step 4' do
+ let(:pre_condition) do
+ <<-eos
+ class { '::tripleo::profile::base::nova':
+ step => #{params[:step]},
+ messaging_hosts => [ '127.0.0.1' ],
+ }
+eos
+ end
+
+ let(:params) { { :step => 4, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::scheduler')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('nova::scheduler')
+ is_expected.to contain_class('nova::scheduler::filter')
+ }
+ end
+ end
+
+
+ on_supported_os.each do |os, facts|
+ context "on #{os}" do
+ let(:facts) do
+ facts.merge({ :hostname => 'node.example.com' })
+ end
+
+ it_behaves_like 'tripleo::profile::base::nova::scheduler'
+ end
+ end
+end
diff --git a/spec/classes/tripleo_profile_base_nova_spec.rb b/spec/classes/tripleo_profile_base_nova_spec.rb
new file mode 100644
index 0000000..8ba78af
--- /dev/null
+++ b/spec/classes/tripleo_profile_base_nova_spec.rb
@@ -0,0 +1,131 @@
+#
+# Copyright (C) 2017 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+require 'spec_helper'
+
+describe 'tripleo::profile::base::nova' do
+ shared_examples_for 'tripleo::profile::base::nova' do
+
+ context 'with step less than 3' do
+ let(:params) { {
+ :step => 1,
+ :messaging_hosts => [ 'localhost' ],
+ :messaging_password => 'foo'
+ } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to_not contain_class('nova')
+ is_expected.to_not contain_class('nova::config')
+ is_expected.to_not contain_class('nova::cache')
+ }
+ end
+
+ context 'with step 3 on bootstrap node' do
+ let(:params) { {
+ :step => 3,
+ :bootstrap_node => 'node.example.com',
+ :messaging_hosts => [ 'localhost' ],
+ :messaging_username => 'nova',
+ :messaging_password => 'foo',
+ } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('nova').with(
+ :default_transport_url => 'rabbit://nova:foo@localhost:5672/?ssl=0'
+ )
+ is_expected.to contain_class('nova::config')
+ is_expected.to contain_class('nova::cache').with(
+ :enabled => true,
+ :backend => 'oslo_cache.memcache_pool',
+ :memcache_servers => ['127.0.0.1:11211']
+ )
+ }
+ end
+
+ context 'with step 3 not on bootstrap node' do
+ let(:params) { {
+ :step => 3,
+ :bootstrap_node => 'other.example.com',
+ :messaging_hosts => [ 'localhost' ],
+ :messaging_password => 'foo'
+ } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to_not contain_class('nova')
+ is_expected.to_not contain_class('nova::config')
+ is_expected.to_not contain_class('nova::cache')
+ }
+ end
+
+ context 'with step 4' do
+ let(:params) { {
+ :step => 4,
+ :bootstrap_node => 'other.example.com',
+ :messaging_hosts => [ 'localhost' ],
+ :messaging_password => 'foo',
+ } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('nova')
+ is_expected.to contain_class('nova::config')
+ is_expected.to contain_class('nova::cache')
+ is_expected.to_not contain_class('nova::migration::libvirt')
+ }
+ end
+
+ context 'with step 4 with libvirt' do
+ let(:pre_condition) {
+ 'include ::nova::compute::libvirt::services'
+ }
+ let(:params) { {
+ :step => 4,
+ :libvirt_enabled => true,
+ :manage_migration => true,
+ :nova_compute_enabled => true,
+ :bootstrap_node => 'node.example.com',
+ :messaging_hosts => [ 'localhost' ],
+ :messaging_password => 'foo',
+ } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('nova')
+ is_expected.to contain_class('nova::config')
+ is_expected.to contain_class('nova::cache')
+ is_expected.to contain_class('nova::migration::libvirt').with(
+ :configure_libvirt => params[:libvirt_enabled],
+ :configure_nova => params[:nova_compute_enabled]
+ )
+ }
+ end
+
+ end
+
+
+ on_supported_os.each do |os, facts|
+ context "on #{os}" do
+ let(:facts) do
+ facts.merge({ :hostname => 'node.example.com' })
+ end
+
+ it_behaves_like 'tripleo::profile::base::nova'
+ end
+ end
+end
diff --git a/spec/classes/tripleo_profile_base_nova_vncproxy_spec.rb b/spec/classes/tripleo_profile_base_nova_vncproxy_spec.rb
new file mode 100644
index 0000000..f077875
--- /dev/null
+++ b/spec/classes/tripleo_profile_base_nova_vncproxy_spec.rb
@@ -0,0 +1,62 @@
+#
+# Copyright (C) 2017 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+
+require 'spec_helper'
+
+describe 'tripleo::profile::base::nova::vncproxy' do
+ shared_examples_for 'tripleo::profile::base::nova::vncproxy' do
+
+ context 'with step less than 4' do
+ let(:params) { { :step => 1, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::vncproxy')
+ is_expected.to_not contain_class('tripleo::profile::base::nova')
+ is_expected.to_not contain_class('nova::vncproxy')
+ }
+ end
+
+ context 'with step 4' do
+ let(:pre_condition) do
+ <<-eos
+ class { '::tripleo::profile::base::nova':
+ step => #{params[:step]},
+ messaging_hosts => [ '127.0.0.1' ],
+ }
+eos
+ end
+
+ let(:params) { { :step => 4, } }
+
+ it {
+ is_expected.to contain_class('tripleo::profile::base::nova::vncproxy')
+ is_expected.to contain_class('tripleo::profile::base::nova')
+ is_expected.to contain_class('nova::vncproxy')
+ }
+ end
+ end
+
+
+ on_supported_os.each do |os, facts|
+ context "on #{os}" do
+ let(:facts) do
+ facts.merge({ :hostname => 'node.example.com' })
+ end
+
+ it_behaves_like 'tripleo::profile::base::nova::vncproxy'
+ end
+ end
+end
diff --git a/spec/defines/tripleo_host_sriov_numvfs_persistence_spec.rb b/spec/defines/tripleo_host_sriov_numvfs_persistence_spec.rb
index 57559a2..153b105 100644
--- a/spec/defines/tripleo_host_sriov_numvfs_persistence_spec.rb
+++ b/spec/defines/tripleo_host_sriov_numvfs_persistence_spec.rb
@@ -12,7 +12,8 @@ describe 'tripleo::host::sriov::numvfs_persistence' do
{
:name => 'persistence',
:vf_defs => ['eth0:10','eth1:8'],
- :content_string => "Hashbang\n"
+ :content_string => "Hashbang\n",
+ :udev_rules => ""
}
end
@@ -31,6 +32,14 @@ describe 'tripleo::host::sriov::numvfs_persistence' do
:content => '#!/bin/bash',
:replace => false,
)
+ is_expected.to contain_file('/etc/udev/rules.d/70-tripleo-reset-sriov.rules').with(
+ :ensure => 'file',
+ :content => "KERNEL==\"eth0\", RUN+=\"/etc/sysconfig/allocate_vfs %k\"\nKERNEL==\"eth1\", RUN+=\"/etc/sysconfig/allocate_vfs %k\"\n",
+ :group => 'root',
+ :mode => '0755',
+ :owner => 'root',
+ :replace => true
+ )
is_expected.to contain_file_line('call_ifup-local').with(
:path => '/sbin/ifup-local',
:line => '/etc/sysconfig/allocate_vfs $1',
diff --git a/spec/fixtures/hieradata/default.yaml b/spec/fixtures/hieradata/default.yaml
index b09e914..4d5dc99 100644
--- a/spec/fixtures/hieradata/default.yaml
+++ b/spec/fixtures/hieradata/default.yaml
@@ -24,3 +24,12 @@ ceph::profile::params::rgw_keystone_admin_password: 'keystone_admin_password'
# cinder related items
cinder::rabbit_password: 'password'
cinder::keystone::authtoken::password: 'password'
+# nova related items
+nova::rabbit_password: 'password'
+nova::keystone::authtoken::password: 'password'
+nova::network::neutron::neutron_password: 'password'
+# memcache related items
+memcached_node_ips_v6:
+ - '::1'
+memcached_node_ips:
+ - '127.0.0.1'
diff --git a/templates/docker_distribution/registry_config.yml.erb b/templates/docker_distribution/registry_config.yml.erb
new file mode 100644
index 0000000..d5228fb
--- /dev/null
+++ b/templates/docker_distribution/registry_config.yml.erb
@@ -0,0 +1,11 @@
+version: 0.1
+log:
+ fields:
+ service: registry
+storage:
+ cache:
+ layerinfo: inmemory
+ filesystem:
+ rootdirectory: /var/lib/registry
+http:
+ addr: <%= @registry_host %>:<%= @registry_port %>