5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
# File 'manifests/deps.pp', line 5
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_api_paste_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']
# 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']
}
}
|