Files
puppet-nova/manifests/deps.pp
Thomas Goirand 8334bd3666 Add support for nova_api_{metadata_,}uwsgi_config in Debian
This patch is adding the configuration of the number of workers,
threads, and the size of the listen queue in Debian, which uses
uwsgi to run Nova API and api-metadata. Therefore, this patch adds
two new nova_api_uwsgi_config and nova_api_metadata_uwsgi_config
providers as well as two new nova::wsgi::uwsgi_api and
nova::wsgi::uwsgi_api_metadata classes.

Change-Id: Idd141edc5cddcfd79cf23e2041dbd1ce6a8252a8
2021-04-11 00:19:00 +02:00

113 lines
4.3 KiB
Puppet

# == Class: nova::deps
#
# Nova anchors and dependency management
#
class nova::deps {
# Setup anchors for install, config and service phases of the module. These
# anchors allow external modules to hook the begin and end of any of these
# phases. Package or service management can also be replaced by ensuring the
# package is absent or turning off service management and having the
# replacement depend on the appropriate anchors. When applicable, end tags
# should be notified so that subscribers can determine if installation,
# config or service state changed and act on that if needed.
anchor { 'nova::install::begin': }
-> Package<| tag == 'nova-package'|>
~> anchor { 'nova::install::end': }
-> anchor { 'nova::config::begin': }
-> Nova_config<||>
~> anchor { 'nova::config::end': }
-> anchor { 'nova::db::begin': }
-> anchor { 'nova::db::end': }
~> anchor { 'nova::service::begin': }
~> Service<| tag == 'nova-service' |>
~> anchor { 'nova::service::end': }
# paste-api.ini config should occur in the config block also.
Anchor['nova::config::begin']
-> Nova_paste_api_ini<||>
~> Anchor['nova::config::end']
# On any uwsgi config change, we must restart Nova APIs.
Anchor['nova::config::begin']
-> Nova_api_uwsgi_config<||>
~> Anchor['nova::config::end']
Anchor['nova::config::begin']
-> Nova_api_metadata_uwsgi_config<||>
~> Anchor['nova::config::end']
# Support packages need to be installed in the install phase, but we don't
# put them in the chain above because we don't want any false dependencies
# between packages with the nova-package tag and the nova-support-package
# tag. Note: the package resources here will have a 'before' relationship on
# the nova::install::end anchor. The line between nova-support-package and
# nova-package should be whether or not Nova services would need to be
# restarted if the package state was changed.
Anchor['nova::install::begin']
-> Package<| tag == 'nova-support-package'|>
-> Anchor['nova::install::end']
# The following resources are managed by calling 'nova manage' and so the
# database must be provisioned before they can be applied.
Anchor['nova::dbsync_api::end']
-> Nova_floating<||>
Anchor['nova::dbsync::end']
-> Nova_floating<||>
# all cache settings should be applied and all packages should be installed
# before service startup
Oslo::Cache<||> -> Anchor['nova::service::begin']
# all db settings should be applied and all packages should be installed
# before dbsync starts
Oslo::Db<||> -> Anchor['nova::dbsync::begin']
# Installation or config changes will always restart services.
Anchor['nova::install::end'] ~> Anchor['nova::service::begin']
Anchor['nova::config::end'] ~> Anchor['nova::service::begin']
#############################################################################
# NOTE(aschultz): these are defined here because this syntax allows us
# to override the subscribe/notify order using the spaceship operator.
# The ->/~> does not seem to be able to be updated after the fact. Since
# we have to flip cell v2 ordering for the N->O upgrade process, we need
# to not use the chaining arrows. ugh.
#############################################################################
# Wedge this in after the db creation and before the services
anchor { 'nova::dbsync_api::begin':
subscribe => Anchor['nova::db::end']
}
-> anchor { 'nova::dbsync_api::end':
notify => Anchor['nova::service::begin'],
}
# Wedge this after db creation and api sync but before the services
anchor { 'nova::dbsync::begin':
subscribe => [
Anchor['nova::db::end'],
Anchor['nova::dbsync_api::end']
]
}
-> anchor { 'nova::dbsync::end':
notify => Anchor['nova::service::begin']
}
# Between api sync and db sync by default but can be overridden
# using the spaceship operator to move it around when needed
anchor { 'nova::cell_v2::begin':
subscribe => Anchor['nova::dbsync_api::end']
}
~> anchor { 'nova::cell_v2::end':
notify => Anchor['nova::dbsync::begin']
}
# Wedge online data migrations after db/api_sync and before service
anchor { 'nova::db_online_data_migrations::begin':
subscribe => Anchor['nova::dbsync_api::end']
}
-> anchor { 'nova::db_online_data_migrations::end':
notify => Anchor['nova::service::begin']
}
}