Fix missing PXE directories for Conductor

When Ironic Conductor class is called, it expects the
PXE directories exist. That is only the case for the step 4.
While there is also a case when the conductor class invoked
for the step 3 & db sync case. For that case also inlcude
the missing ironic::pxe class to ensure the PXE directories
created.

Closes-Bug: #1845222

Change-Id: I394f56ba9b213c75378bdf21999d23509632523c
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya 2019-09-25 12:23:50 +02:00
parent 2fede0c3af
commit 2f69faf666
1 changed files with 18 additions and 2 deletions

View File

@ -18,6 +18,10 @@
#
# === Parameters
#
# [*bootstrap_node*]
# (Optional) The hostname of the node responsible for bootstrapping tasks
# Defaults to hiera('cinder_backup_short_bootstrap_node_name')
#
# [*step*]
# (Optional) The current step of the deployment
# Defaults to hiera('step')
@ -31,11 +35,23 @@
# Defaults to false
#
class tripleo::profile::base::ironic::conductor (
$step = Integer(hiera('step')),
$manage_pxe = true,
$bootstrap_node = hiera('ironic_api_short_bootstrap_node_name', undef),
$step = Integer(hiera('step')),
$manage_pxe = true,
$enable_staging = false,
) {
include ::tripleo::profile::base::ironic
# Database is accessed by both API and conductor, hence it's here.
if $::hostname == downcase($bootstrap_node) {
$sync_db = true
} else {
$sync_db = false
}
# Ironic conductor class expects PXE directories exist
if ($step >= 3 and $sync_db) and $manage_pxe {
include ::ironic::pxe
}
if $step >= 4 {
include ::ironic::conductor