File: deps.pp

package info (click to toggle)
puppet-module-glance 9.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,008 kB
  • ctags: 73
  • sloc: ruby: 5,522; python: 35; sh: 19; makefile: 17
file content (61 lines) | stat: -rw-r--r-- 3,181 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: glance::deps
#
#  glance anchors and dependency management
#
class glance::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 { 'glance::install::begin': }
  -> Package<| tag == 'glance-package'|>
  ~> anchor { 'glance::install::end': }
  -> anchor { 'glance::config::begin': }
  -> File<| tag == 'glance-config-file' |>
  ~> anchor { 'glance::config::end': }
  -> anchor { 'glance::db::begin': }
  -> anchor { 'glance::db::end': }
  ~> anchor { 'glance::dbsync::begin': }
  -> anchor { 'glance::dbsync::end': }
  ~> anchor { 'glance::service::begin': }
  ~> Service<| tag == 'glance-service' |>
  ~> anchor { 'glance::service::end': }

  # Ensure files are modified in the config block
  Anchor['glance::config::begin']
  -> File_line<| tag == 'glance-file-line' |>
  ~> Anchor['glance::config::end']

  # Ensure all files are in place before modifying them
  File<| tag == 'glance-config-file' |> -> File_line<| tag == 'glance-file-line' |>

  # All other inifile providers need to be processed in the config block
  Anchor['glance::config::begin'] -> Glance_api_config<||> ~> Anchor['glance::config::end']
  Anchor['glance::config::begin'] -> Glance_api_paste_ini<||> ~> Anchor['glance::config::end']
  Anchor['glance::config::begin'] -> Glance_cache_config<||> ~> Anchor['glance::config::end']
  Anchor['glance::config::begin'] -> Glance_glare_config<||> ~> Anchor['glance::config::end']
  Anchor['glance::config::begin'] -> Glance_glare_paste_ini<||> ~> Anchor['glance::config::end']
  Anchor['glance::config::begin'] -> Glance_registry_config<||> ~> Anchor['glance::config::end']
  Anchor['glance::config::begin'] -> Glance_registry_paste_ini<||> ~> Anchor['glance::config::end']
  Anchor['glance::config::begin'] -> Glance_swift_config<||> ~> Anchor['glance::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 glance-package tag and the glance-support-package
  # tag.  Note: the package resources here will have a 'before' relationshop on
  # the glance::install::end anchor.  The line between glance-support-package and
  # glance-package should be whether or not glance services would need to be
  # restarted if the package state was changed.
  Anchor['glance::install::begin']
  -> Package<| tag == 'glance-support-package'|>
  -> Anchor['glance::install::end']

  Anchor['glance::service::end'] -> Glance_image<||>

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