File: deps.pp

package info (click to toggle)
puppet-module-cloudkitty 14.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,056 kB
  • sloc: ruby: 2,270; python: 38; sh: 10; makefile: 10
file content (61 lines) | stat: -rw-r--r-- 2,542 bytes parent folder | download
1
2
3
4
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
# == Class: cloudkitty::deps
#
#  cloudkitty anchors and dependency management
#
class cloudkitty::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 { 'cloudkitty::install::begin': }
  -> Package<| tag == 'cloudkitty-package'|>
  ~> anchor { 'cloudkitty::install::end': }
  -> anchor { 'cloudkitty::config::begin': }
  -> Cloudkitty_config<||>
  ~> anchor { 'cloudkitty::config::end': }
  -> anchor { 'cloudkitty::db::begin': }
  -> anchor { 'cloudkitty::db::end': }
  ~> anchor { 'cloudkitty::dbsync::begin': }
  -> anchor { 'cloudkitty::dbsync::end': }
  ~> anchor { 'cloudkitty::storageinit::begin': }
  -> anchor { 'cloudkitty::storageinit::end': }
  ~> anchor { 'cloudkitty::service::begin': }
  ~> Service<| tag == 'cloudkitty-service' |>
  ~> anchor { 'cloudkitty::service::end': }

  # paste-api.ini config should occur in the config block also.
  Anchor['cloudkitty::config::begin']
  -> Cloudkitty_api_paste_ini<||>
  ~> Anchor['cloudkitty::config::end']

  # all coordination settings should be applied and all packages should be
  # installed before service startup
  Oslo::Coordination<||> -> Anchor['cloudkitty::service::begin']

  # all db settings should be applied and all packages should be installed
  # before dbsync starts
  Oslo::Db<||> -> Anchor['cloudkitty::dbsync::begin']

  # policy config should occur in the config block also.
  Anchor['cloudkitty::config::begin']
  -> Openstacklib::Policy<| tag == 'cloudkitty' |>
  -> Anchor['cloudkitty::config::end']

  # On any uwsgi config change, we must restart Cloudkitty API.
  Anchor['cloudkitty::config::begin']
  -> Cloudkitty_api_uwsgi_config<||>
  ~> Anchor['cloudkitty::config::end']

  # Ensure files are modified in the config block
  Anchor['cloudkitty::config::begin']
  -> File<| tag == 'cloudkitty-yamls' |>
  ~> Anchor['cloudkitty::config::end']

  # Installation or config changes will always restart services.
  Anchor['cloudkitty::install::end'] ~> Anchor['cloudkitty::service::begin']
  Anchor['cloudkitty::config::end']  ~> Anchor['cloudkitty::service::begin']

}