aboutsummaryrefslogtreecommitdiffstats
path: root/manifests/profile/base/nova
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/profile/base/nova')
-rw-r--r--manifests/profile/base/nova/api.pp26
-rw-r--r--manifests/profile/base/nova/compute.pp34
-rw-r--r--manifests/profile/base/nova/compute/ironic.pp34
-rw-r--r--manifests/profile/base/nova/compute/libvirt.pp3
-rw-r--r--manifests/profile/base/nova/conductor.pp2
-rw-r--r--manifests/profile/base/nova/consoleauth.pp2
-rw-r--r--manifests/profile/base/nova/libvirt.pp1
-rw-r--r--manifests/profile/base/nova/scheduler.pp2
-rw-r--r--manifests/profile/base/nova/vncproxy.pp2
9 files changed, 85 insertions, 21 deletions
diff --git a/manifests/profile/base/nova/api.pp b/manifests/profile/base/nova/api.pp
index 4064b1e..285e0b7 100644
--- a/manifests/profile/base/nova/api.pp
+++ b/manifests/profile/base/nova/api.pp
@@ -16,28 +16,30 @@
#
# Nova API profile for tripleo
#
-# === Parameters
+# [*bootstrap_node*]
+# (Optional) The hostname of the node responsible for bootstrapping tasks
+# Defaults to hiera('bootstrap_nodeid')
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
# Defaults to hiera('step')
#
-# [*sync_db*]
-# (Optional) Whether to run db sync
-# Defaults to true
-#
class tripleo::profile::base::nova::api (
- $step = hiera('step'),
- $sync_db = true,
+ $bootstrap_node = hiera('bootstrap_nodeid', undef),
+ $step = hiera('step'),
) {
+ if $::hostname == downcase($bootstrap_node) {
+ $sync_db = true
+ } else {
+ $sync_db = false
+ }
include ::tripleo::profile::base::nova
- if $step >= 2 and $sync_db {
+ if $step >= 3 and $sync_db {
include ::nova::db::mysql
include ::nova::db::mysql_api
- Exec<| title == 'galera-ready'|> -> Anchor['nova::db::begin']
}
if $step >= 4 or ($step >= 3 and $sync_db) {
@@ -47,5 +49,11 @@ class tripleo::profile::base::nova::api (
}
include ::nova::network::neutron
}
+
+ if $step >= 5 {
+ if hiera('nova_enable_db_purge', true) {
+ include ::nova::cron::archive_deleted_rows
+ }
+ }
}
diff --git a/manifests/profile/base/nova/compute.pp b/manifests/profile/base/nova/compute.pp
index 579b474..076996a 100644
--- a/manifests/profile/base/nova/compute.pp
+++ b/manifests/profile/base/nova/compute.pp
@@ -23,8 +23,13 @@
# for more details.
# Defaults to hiera('step')
#
+# [*cinder_nfs_backend*]
+# (Optional) Whether or not Cinder is backed by NFS.
+# Defaults to hiera('cinder_enable_nfs_backend', false)
+#
class tripleo::profile::base::nova::compute (
- $step = hiera('step'),
+ $step = hiera('step'),
+ $cinder_nfs_backend = hiera('cinder_enable_nfs_backend', false),
) {
if $step >= 4 {
@@ -33,9 +38,36 @@ class tripleo::profile::base::nova::compute (
# deploy basic bits for nova-compute
include ::nova::compute
+ # If Service['nova-conductor'] is in catalog, make sure we start it
+ # before nova-compute.
+ Service<| title == 'nova-conductor' |> -> Service['nova-compute']
# deploy bits to connect nova compute to neutron
include ::nova::network::neutron
+
+ # When utilising images for deployment, we need to reset the iSCSI initiator name to make it unique
+ # https://bugzilla.redhat.com/show_bug.cgi?id=1244328
+ exec { 'reset-iscsi-initiator-name':
+ command => '/bin/echo InitiatorName=$(/usr/sbin/iscsi-iname) > /etc/iscsi/initiatorname.iscsi',
+ onlyif => '/usr/bin/test ! -f /etc/iscsi/.initiator_reset',
+ before => File['/etc/iscsi/.initiator_reset'],
+ }
+ file { '/etc/iscsi/.initiator_reset':
+ ensure => present,
+ }
+ }
+
+ # If NFS is used as a Cinder backend
+ if $cinder_nfs_backend {
+ ensure_packages('nfs-utils', { ensure => present })
+ Package['nfs-utils'] -> Service['nova-compute']
+ if str2bool($::selinux) {
+ selboolean { 'virt_use_nfs':
+ value => on,
+ persistent => true,
+ }
+ Selboolean['virt_use_nfs'] -> Package['nfs-utils']
+ }
}
}
diff --git a/manifests/profile/base/nova/compute/ironic.pp b/manifests/profile/base/nova/compute/ironic.pp
new file mode 100644
index 0000000..c0213fb
--- /dev/null
+++ b/manifests/profile/base/nova/compute/ironic.pp
@@ -0,0 +1,34 @@
+# 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::compute::ironic
+#
+# Nova Compute Ironic profile for tripleo
+#
+# === Parameters
+#
+# [*step*]
+# (Optional) The current step in deployment. See tripleo-heat-templates
+# for more details.
+# Defaults to hiera('step')
+#
+class tripleo::profile::base::nova::compute::ironic (
+ $step = hiera('step'),
+) {
+ if $step >= 4 {
+ include ::tripleo::profile::base::nova::compute
+ include ::nova::compute::ironic
+ include ::nova::network::neutron
+ }
+}
diff --git a/manifests/profile/base/nova/compute/libvirt.pp b/manifests/profile/base/nova/compute/libvirt.pp
index 74af7fc..956f8ad 100644
--- a/manifests/profile/base/nova/compute/libvirt.pp
+++ b/manifests/profile/base/nova/compute/libvirt.pp
@@ -26,7 +26,6 @@
class tripleo::profile::base::nova::compute::libvirt (
$step = hiera('step'),
) {
-
if $step >= 4 {
include ::tripleo::profile::base::nova::compute
@@ -35,7 +34,7 @@ class tripleo::profile::base::nova::compute::libvirt (
$rbd_persistent_storage = hiera('rbd_persistent_storage', false)
if $rbd_ephemeral_storage or $rbd_persistent_storage {
$client_keys = hiera('ceph::profile::params::client_keys')
- $client_user = join(['client.', hiera('tripleo::profile::base::cinder::volume::rbd::cinder_rbd_user_name')])
+ $client_user = join(['client.', hiera('nova::compute::rbd::libvirt_rbd_user')])
class { '::nova::compute::rbd':
libvirt_rbd_secret_key => $client_keys[$client_user]['secret'],
}
diff --git a/manifests/profile/base/nova/conductor.pp b/manifests/profile/base/nova/conductor.pp
index 04c9d06..fa9f12b 100644
--- a/manifests/profile/base/nova/conductor.pp
+++ b/manifests/profile/base/nova/conductor.pp
@@ -26,10 +26,8 @@
class tripleo::profile::base::nova::conductor (
$step = hiera('step'),
) {
-
include ::tripleo::profile::base::nova
if $step >= 4 {
include ::nova::conductor
}
-
}
diff --git a/manifests/profile/base/nova/consoleauth.pp b/manifests/profile/base/nova/consoleauth.pp
index 442cf84..8ccfb8c 100644
--- a/manifests/profile/base/nova/consoleauth.pp
+++ b/manifests/profile/base/nova/consoleauth.pp
@@ -26,10 +26,8 @@
class tripleo::profile::base::nova::consoleauth (
$step = hiera('step'),
) {
-
if $step >= 4 {
include ::tripleo::profile::base::nova
include ::nova::consoleauth
}
-
}
diff --git a/manifests/profile/base/nova/libvirt.pp b/manifests/profile/base/nova/libvirt.pp
index 29ef372..889b80d 100644
--- a/manifests/profile/base/nova/libvirt.pp
+++ b/manifests/profile/base/nova/libvirt.pp
@@ -26,7 +26,6 @@
class tripleo::profile::base::nova::libvirt (
$step = hiera('step'),
) {
-
if $step >= 4 {
include ::tripleo::profile::base::nova
include ::nova::compute::libvirt::services
diff --git a/manifests/profile/base/nova/scheduler.pp b/manifests/profile/base/nova/scheduler.pp
index 13b4e82..3c9b2c2 100644
--- a/manifests/profile/base/nova/scheduler.pp
+++ b/manifests/profile/base/nova/scheduler.pp
@@ -26,11 +26,9 @@
class tripleo::profile::base::nova::scheduler (
$step = hiera('step'),
) {
-
if $step >= 4 {
include ::tripleo::profile::base::nova
include ::nova::scheduler
include ::nova::scheduler::filter
}
-
}
diff --git a/manifests/profile/base/nova/vncproxy.pp b/manifests/profile/base/nova/vncproxy.pp
index aa0cc7b..f654fef 100644
--- a/manifests/profile/base/nova/vncproxy.pp
+++ b/manifests/profile/base/nova/vncproxy.pp
@@ -26,10 +26,8 @@
class tripleo::profile::base::nova::vncproxy (
$step = hiera('step'),
) {
-
if $step >= 4 {
include ::tripleo::profile::base::nova
include ::nova::vncproxy
}
-
}