|
80 | 80 | Array $admin_roles = $mongodb::params::admin_roles,
|
81 | 81 | ) inherits mongodb::params {
|
82 | 82 |
|
| 83 | + contain mongodb::server::install |
| 84 | + contain mongodb::server::config |
| 85 | + contain mongodb::server::service |
| 86 | + |
83 | 87 | if ($ensure == 'present' or $ensure == true) {
|
| 88 | + Class['mongodb::server::install'] -> Class['mongodb::server::config'] |
| 89 | + |
84 | 90 | if $restart {
|
85 |
| - anchor { 'mongodb::server::start': } |
86 |
| - -> class { 'mongodb::server::install': } |
87 | 91 | # If $restart is true, notify the service on config changes (~>)
|
88 |
| - -> class { 'mongodb::server::config': } |
89 |
| - ~> class { 'mongodb::server::service': } |
90 |
| - -> anchor { 'mongodb::server::end': } |
| 92 | + Class['mongodb::server::config'] ~> Class['mongodb::server::service'] |
91 | 93 | } else {
|
92 |
| - anchor { 'mongodb::server::start': } |
93 |
| - -> class { 'mongodb::server::install': } |
94 | 94 | # If $restart is false, config changes won't restart the service (->)
|
95 |
| - -> class { 'mongodb::server::config': } |
96 |
| - -> class { 'mongodb::server::service': } |
97 |
| - -> anchor { 'mongodb::server::end': } |
| 95 | + Class['mongodb::server::config'] -> Class['mongodb::server::service'] |
98 | 96 | }
|
99 | 97 | } else {
|
100 |
| - anchor { 'mongodb::server::start': } |
101 |
| - -> class { 'mongodb::server::service': } |
102 |
| - -> class { 'mongodb::server::config': } |
103 |
| - -> class { 'mongodb::server::install': } |
104 |
| - -> anchor { 'mongodb::server::end': } |
| 98 | + Class['mongodb::server::service'] -> Class['mongodb::server::config'] -> Class['mongodb::server::install'] |
105 | 99 | }
|
106 | 100 |
|
107 | 101 | if $create_admin and ($service_ensure == 'running' or $service_ensure == true) {
|
|
111 | 105 | roles => $admin_roles,
|
112 | 106 | }
|
113 | 107 |
|
114 |
| - # Make sure it runs at the correct point |
115 |
| - Anchor['mongodb::server::end'] -> Mongodb::Db['admin'] |
116 |
| - |
117 | 108 | # Make sure it runs before other DB creation
|
118 | 109 | Mongodb::Db['admin'] -> Mongodb::Db <| title != 'admin' |>
|
119 | 110 | }
|
|
148 | 139 |
|
149 | 140 | $replset_config_real = $_replset_config # lint:ignore:variable_is_lowercase required for compatibility
|
150 | 141 |
|
151 |
| - Anchor['mongodb::server::end'] -> Class['mongodb::replset'] |
152 |
| - |
153 | 142 | # Make sure that the ordering is correct
|
154 | 143 | if $create_admin {
|
155 | 144 | Class['mongodb::replset'] -> Mongodb::Db['admin']
|
|
0 commit comments