puppet-placement/manifests/deps.pp
Takashi Kajinami 7fe2730094 Refactor resource dependencies
This refactors resource dependencies to improve the following points.

 - Avoid unnecessary dependencies across services. For example aodh
   service does not require cinder db.

 - Restart only api service when config files like paste.ini, which
   are used only be api service is changed.

This also removes the unused placement-support-package tag.

Change-Id: I31bac02c5895dc6f4090c1012db14bcdc1100aa3
2024-02-17 21:24:28 +09:00

36 lines
1.5 KiB
Puppet

# == Class: placement::deps
#
# placement anchors and dependency management
#
class placement::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 { 'placement::install::begin': }
-> Package<| tag == 'placement-package'|>
~> anchor { 'placement::install::end': }
-> anchor { 'placement::config::begin': }
-> Placement_config<||>
~> anchor { 'placement::config::end': }
-> anchor { 'placement::db::begin': }
-> anchor { 'placement::db::end': }
~> anchor { 'placement::dbsync::begin': }
-> anchor { 'placement::dbsync::end': }
~> anchor { 'placement::service::begin': }
~> Service<| tag == 'placement-service' |>
~> anchor { 'placement::service::end': }
Anchor['placement::config::begin']
-> Placement_api_uwsgi_config<||>
-> Anchor['placement::config::end']
# Installation or config changes will always restart services.
Anchor['placement::install::end'] ~> Anchor['placement::service::begin']
Anchor['placement::config::end'] ~> Anchor['placement::service::begin']
}