Replace legacy facts and use fact hash
... because the latest lint no longer allows usage of legacy facts and
top scope fact.
Change-Id: Ia9ab733a7fc5cbb5b23659ff7cbfd3b2b7d2fb18
Takashi Kajinami
1 year, 2 months ago
12 | 12 | # [*max_limit*] |
13 | 13 | # (optional) The maximum number of items returned in a |
14 | 14 | # single response from a collection resource. |
15 | # Defaults to $::os_service_default | |
15 | # Defaults to $facts['os_service_default'] | |
16 | 16 | # |
17 | 17 | # [*package_ensure*] |
18 | 18 | # (optional) ensure state for package. |
38 | 38 | # |
39 | 39 | # [*paste_config*] |
40 | 40 | # (Optional) Path to API paste configuration. |
41 | # Defaults to $::os_service_default. | |
41 | # Defaults to $facts['os_service_default']. | |
42 | 42 | # |
43 | 43 | # [*operation_timeout*] |
44 | 44 | # (Optional) Number of seconds before timeout when attempting to do some |
45 | 45 | # operations. |
46 | # Defaults to $::os_service_default. | |
46 | # Defaults to $facts['os_service_default']. | |
47 | 47 | # |
48 | 48 | # [*enable_proxy_headers_parsing*] |
49 | 49 | # (Optional) Enable paste middleware to handle SSL requests through |
50 | 50 | # HTTPProxyToWSGI middleware. |
51 | # Defaults to $::os_service_default. | |
51 | # Defaults to $facts['os_service_default']. | |
52 | 52 | # |
53 | 53 | # [*max_request_body_size*] |
54 | 54 | # (Optional) Set max request body size |
55 | # Defaults to $::os_service_default. | |
55 | # Defaults to $facts['os_service_default']. | |
56 | 56 | # |
57 | 57 | class gnocchi::api ( |
58 | 58 | $manage_service = true, |
59 | 59 | $enabled = true, |
60 | 60 | $package_ensure = 'present', |
61 | $max_limit = $::os_service_default, | |
61 | $max_limit = $facts['os_service_default'], | |
62 | 62 | $service_name = $::gnocchi::params::api_service_name, |
63 | 63 | $sync_db = false, |
64 | 64 | $auth_strategy = 'keystone', |
65 | $paste_config = $::os_service_default, | |
66 | $operation_timeout = $::os_service_default, | |
67 | $enable_proxy_headers_parsing = $::os_service_default, | |
68 | $max_request_body_size = $::os_service_default, | |
65 | $paste_config = $facts['os_service_default'], | |
66 | $operation_timeout = $facts['os_service_default'], | |
67 | $enable_proxy_headers_parsing = $facts['os_service_default'], | |
68 | $max_request_body_size = $facts['os_service_default'], | |
69 | 69 | ) inherits gnocchi::params { |
70 | 70 | |
71 | 71 | include gnocchi::deps |
7 | 7 | # (Optional) Indicate whether this resource may be shared with the domain |
8 | 8 | # received in the requests "origin" header. |
9 | 9 | # (string value) |
10 | # Defaults to $::os_service_default. | |
10 | # Defaults to $facts['os_service_default']. | |
11 | 11 | # |
12 | 12 | # [*allow_credentials*] |
13 | 13 | # (Optional) Indicate that the actual request can include user credentials. |
14 | 14 | # (boolean value) |
15 | # Defaults to $::os_service_default. | |
15 | # Defaults to $facts['os_service_default']. | |
16 | 16 | # |
17 | 17 | # [*expose_headers*] |
18 | 18 | # (Optional) Indicate which headers are safe to expose to the API. |
19 | 19 | # (list value) |
20 | # Defaults to $::os_service_default. | |
20 | # Defaults to $facts['os_service_default']. | |
21 | 21 | # |
22 | 22 | # [*max_age*] |
23 | 23 | # (Optional) Maximum cache age of CORS preflight requests. |
24 | 24 | # (integer value) |
25 | # Defaults to $::os_service_default. | |
25 | # Defaults to $facts['os_service_default']. | |
26 | 26 | # |
27 | 27 | # [*allow_methods*] |
28 | 28 | # (Optional) Indicate which methods can be used during the actual request. |
29 | 29 | # (list value) |
30 | # Defaults to $::os_service_default. | |
30 | # Defaults to $facts['os_service_default']. | |
31 | 31 | # |
32 | 32 | # [*allow_headers*] |
33 | 33 | # (Optional) Indicate which header field names may be used during the actual |
34 | 34 | # request. |
35 | 35 | # (list value) |
36 | # Defaults to $::os_service_default. | |
36 | # Defaults to $facts['os_service_default']. | |
37 | 37 | # |
38 | 38 | class gnocchi::cors ( |
39 | $allowed_origin = $::os_service_default, | |
40 | $allow_credentials = $::os_service_default, | |
41 | $expose_headers = $::os_service_default, | |
42 | $max_age = $::os_service_default, | |
43 | $allow_methods = $::os_service_default, | |
44 | $allow_headers = $::os_service_default, | |
39 | $allowed_origin = $facts['os_service_default'], | |
40 | $allow_credentials = $facts['os_service_default'], | |
41 | $expose_headers = $facts['os_service_default'], | |
42 | $max_age = $facts['os_service_default'], | |
43 | $allow_methods = $facts['os_service_default'], | |
44 | $allow_headers = $facts['os_service_default'], | |
45 | 45 | ) { |
46 | 46 | |
47 | 47 | include gnocchi::deps |
5 | 5 | # |
6 | 6 | # [*detailed*] |
7 | 7 | # (Optional) Show more detailed information as part of the response. |
8 | # Defaults to $::os_service_default | |
8 | # Defaults to $facts['os_service_default'] | |
9 | 9 | # |
10 | 10 | # [*backends*] |
11 | 11 | # (Optional) Additional backends that can perform health checks and report |
12 | 12 | # that information back as part of a request. |
13 | # Defaults to $::os_service_default | |
13 | # Defaults to $facts['os_service_default'] | |
14 | 14 | # |
15 | 15 | # [*disable_by_file_path*] |
16 | 16 | # (Optional) Check the presence of a file to determine if an application |
17 | 17 | # is running on a port. |
18 | # Defaults to $::os_service_default | |
18 | # Defaults to $facts['os_service_default'] | |
19 | 19 | # |
20 | 20 | # [*disable_by_file_paths*] |
21 | 21 | # (Optional) Check the presence of a file to determine if an application |
22 | 22 | # is running on a port. Expects a "port:path" list of strings. |
23 | # Defaults to $::os_service_default | |
23 | # Defaults to $facts['os_service_default'] | |
24 | 24 | # |
25 | 25 | class gnocchi::healthcheck ( |
26 | $detailed = $::os_service_default, | |
27 | $backends = $::os_service_default, | |
28 | $disable_by_file_path = $::os_service_default, | |
29 | $disable_by_file_paths = $::os_service_default, | |
26 | $detailed = $facts['os_service_default'], | |
27 | $backends = $facts['os_service_default'], | |
28 | $disable_by_file_path = $facts['os_service_default'], | |
29 | $disable_by_file_paths = $facts['os_service_default'], | |
30 | 30 | ) { |
31 | 31 | |
32 | 32 | include gnocchi::deps |
9 | 9 | # |
10 | 10 | # [*coordination_url*] |
11 | 11 | # (optional) The url to use for distributed group membership coordination. |
12 | # Defaults to $::os_service_default. | |
12 | # Defaults to $facts['os_service_default']. | |
13 | 13 | # |
14 | 14 | # [*purge_config*] |
15 | 15 | # (optional) Whether to set only the specified config options |
18 | 18 | # |
19 | 19 | class gnocchi ( |
20 | 20 | $package_ensure = 'present', |
21 | $coordination_url = $::os_service_default, | |
21 | $coordination_url = $facts['os_service_default'], | |
22 | 22 | $purge_config = false, |
23 | 23 | ) inherits gnocchi::params { |
24 | 24 |
9 | 9 | # |
10 | 10 | # [*password*] |
11 | 11 | # (Optional) Password to create for the service user |
12 | # Defaults to $::os_service_default | |
12 | # Defaults to $facts['os_service_default'] | |
13 | 13 | # |
14 | 14 | # [*auth_url*] |
15 | 15 | # (Optional) The URL to use for authentication. |
29 | 29 | # |
30 | 30 | # [*system_scope*] |
31 | 31 | # (Optional) Scope for system operations. |
32 | # Defaults to $::os_service_default | |
32 | # Defaults to $facts['os_service_default'] | |
33 | 33 | # |
34 | 34 | # [*insecure*] |
35 | 35 | # (Optional) If true, explicitly allow TLS without checking server cert |
36 | 36 | # against any certificate authorities. WARNING: not recommended. Use with |
37 | 37 | # caution. |
38 | # Defaults to $::os_service_default | |
38 | # Defaults to $facts['os_service_default'] | |
39 | 39 | # |
40 | 40 | # [*auth_section*] |
41 | 41 | # (Optional) Config Section from which to load plugin specific options |
42 | # Defaults to $::os_service_default. | |
42 | # Defaults to $facts['os_service_default']. | |
43 | 43 | # |
44 | 44 | # [*auth_type*] |
45 | 45 | # (Optional) Authentication type to load |
51 | 51 | # |
52 | 52 | # [*auth_version*] |
53 | 53 | # (Optional) API version of the admin Identity API endpoint. |
54 | # Defaults to $::os_service_default. | |
54 | # Defaults to $facts['os_service_default']. | |
55 | 55 | # |
56 | 56 | # [*cache*] |
57 | 57 | # (Optional) Env key for the swift cache. |
58 | # Defaults to $::os_service_default. | |
58 | # Defaults to $facts['os_service_default']. | |
59 | 59 | # |
60 | 60 | # [*cafile*] |
61 | 61 | # (Optional) A PEM encoded Certificate Authority to use when verifying HTTPs |
62 | 62 | # connections. |
63 | # Defaults to $::os_service_default. | |
63 | # Defaults to $facts['os_service_default']. | |
64 | 64 | # |
65 | 65 | # [*certfile*] |
66 | 66 | # (Optional) Required if identity server requires client certificate |
67 | # Defaults to $::os_service_default. | |
67 | # Defaults to $facts['os_service_default']. | |
68 | 68 | # |
69 | 69 | # [*delay_auth_decision*] |
70 | 70 | # (Optional) Do not handle authorization requests within the middleware, but |
71 | 71 | # delegate the authorization decision to downstream WSGI components. Boolean |
72 | 72 | # value |
73 | # Defaults to $::os_service_default. | |
73 | # Defaults to $facts['os_service_default']. | |
74 | 74 | # |
75 | 75 | # [*enforce_token_bind*] |
76 | 76 | # (Optional) Used to control the use and type of token binding. Can be set |
80 | 80 | # type is unknown the token will be rejected. "required" any form of token |
81 | 81 | # binding is needed to be allowed. Finally the name of a binding method that |
82 | 82 | # must be present in tokens. String value. |
83 | # Defaults to $::os_service_default. | |
83 | # Defaults to $facts['os_service_default']. | |
84 | 84 | # |
85 | 85 | # [*http_connect_timeout*] |
86 | 86 | # (Optional) Request timeout value for communicating with Identity API |
87 | 87 | # server. |
88 | # Defaults to $::os_service_default. | |
88 | # Defaults to $facts['os_service_default']. | |
89 | 89 | # |
90 | 90 | # [*http_request_max_retries*] |
91 | 91 | # (Optional) How many times are we trying to reconnect when communicating |
92 | 92 | # with Identity API Server. Integer value |
93 | # Defaults to $::os_service_default. | |
93 | # Defaults to $facts['os_service_default']. | |
94 | 94 | # |
95 | 95 | # [*include_service_catalog*] |
96 | 96 | # (Optional) Indicate whether to set the X-Service-Catalog header. If False, |
97 | 97 | # middleware will not ask for service catalog on token validation and will |
98 | 98 | # not set the X-Service-Catalog header. Boolean value. |
99 | # Defaults to $::os_service_default. | |
99 | # Defaults to $facts['os_service_default']. | |
100 | 100 | # |
101 | 101 | # [*keyfile*] |
102 | 102 | # (Optional) Required if identity server requires client certificate |
103 | # Defaults to $::os_service_default. | |
103 | # Defaults to $facts['os_service_default']. | |
104 | 104 | # |
105 | 105 | # [*memcache_pool_conn_get_timeout*] |
106 | 106 | # (Optional) Number of seconds that an operation will wait to get a memcached |
107 | 107 | # client connection from the pool. Integer value |
108 | # Defaults to $::os_service_default. | |
108 | # Defaults to $facts['os_service_default']. | |
109 | 109 | # |
110 | 110 | # [*memcache_pool_dead_retry*] |
111 | 111 | # (Optional) Number of seconds memcached server is considered dead before it |
112 | 112 | # is tried again. Integer value |
113 | # Defaults to $::os_service_default. | |
113 | # Defaults to $facts['os_service_default']. | |
114 | 114 | # |
115 | 115 | # [*memcache_pool_maxsize*] |
116 | 116 | # (Optional) Maximum total number of open connections to every memcached |
117 | 117 | # server. Integer value |
118 | # Defaults to $::os_service_default. | |
118 | # Defaults to $facts['os_service_default']. | |
119 | 119 | # |
120 | 120 | # [*memcache_pool_socket_timeout*] |
121 | 121 | # (Optional) Number of seconds a connection to memcached is held unused in |
122 | 122 | # the pool before it is closed. Integer value |
123 | # Defaults to $::os_service_default. | |
123 | # Defaults to $facts['os_service_default']. | |
124 | 124 | # |
125 | 125 | # [*memcache_pool_unused_timeout*] |
126 | 126 | # (Optional) Number of seconds a connection to memcached is held unused in |
127 | 127 | # the pool before it is closed. Integer value |
128 | # Defaults to $::os_service_default. | |
128 | # Defaults to $facts['os_service_default']. | |
129 | 129 | # |
130 | 130 | # [*memcache_secret_key*] |
131 | 131 | # (Optional, mandatory if memcache_security_strategy is defined) This string |
132 | 132 | # is used for key derivation. |
133 | # Defaults to $::os_service_default. | |
133 | # Defaults to $facts['os_service_default']. | |
134 | 134 | # |
135 | 135 | # [*memcache_security_strategy*] |
136 | 136 | # (Optional) If defined, indicate whether token data should be authenticated |
138 | 138 | # HMAC) in the cache. If ENCRYPT, token data is encrypted and authenticated in the |
139 | 139 | # cache. If the value is not one of these options or empty, auth_token will |
140 | 140 | # raise an exception on initialization. |
141 | # Defaults to $::os_service_default. | |
141 | # Defaults to $facts['os_service_default']. | |
142 | 142 | # |
143 | 143 | # [*memcache_use_advanced_pool*] |
144 | 144 | # (Optional) Use the advanced (eventlet safe) memcached client pool. The |
145 | 145 | # advanced pool will only work under python 2.x Boolean value |
146 | # Defaults to $::os_service_default. | |
146 | # Defaults to $facts['os_service_default']. | |
147 | 147 | # |
148 | 148 | # [*memcached_servers*] |
149 | 149 | # (Optional) Optionally specify a list of memcached server(s) to use for |
150 | 150 | # caching. If left undefined, tokens will instead be cached in-process. |
151 | # Defaults to $::os_service_default. | |
151 | # Defaults to $facts['os_service_default']. | |
152 | 152 | # |
153 | 153 | # [*manage_memcache_package*] |
154 | 154 | # (Optional) Whether to install the python-memcache package. |
156 | 156 | # |
157 | 157 | # [*region_name*] |
158 | 158 | # (Optional) The region in which the identity server can be found. |
159 | # Defaults to $::os_service_default. | |
159 | # Defaults to $facts['os_service_default']. | |
160 | 160 | # |
161 | 161 | # [*token_cache_time*] |
162 | 162 | # (Optional) In order to prevent excessive effort spent validating tokens, |
163 | 163 | # the middleware caches previously-seen tokens for a configurable duration |
164 | 164 | # (in seconds). Set to -1 to disable caching completely. Integer value |
165 | # Defaults to $::os_service_default. | |
165 | # Defaults to $facts['os_service_default']. | |
166 | 166 | # |
167 | 167 | # [*service_token_roles*] |
168 | 168 | # (Optional) A choice of roles that must be present in a service token. |
172 | 172 | # here are applied as an ANY check so any role in this list |
173 | 173 | # must be present. For backwards compatibility reasons this |
174 | 174 | # currently only affects the allow_expired check. (list value) |
175 | # Defaults to $::os_service_default. | |
175 | # Defaults to $facts['os_service_default']. | |
176 | 176 | # |
177 | 177 | # [*service_token_roles_required*] |
178 | 178 | # (optional) backwards compatibility to ensure that the service tokens are |
179 | 179 | # compared against a list of possible roles for validity |
180 | 180 | # true/false |
181 | # Defaults to $::os_service_default. | |
181 | # Defaults to $facts['os_service_default']. | |
182 | 182 | # |
183 | 183 | # [*service_type*] |
184 | 184 | # (Optional) The name or type of the service as it appears in the service |
185 | 185 | # catalog. This is used to validate tokens that have restricted access rules. |
186 | # Defaults to $::os_service_default. | |
186 | # Defaults to $facts['os_service_default']. | |
187 | 187 | # |
188 | 188 | # [*interface*] |
189 | 189 | # (Optional) Interface to use for the Identity API endpoint. Valid values are |
190 | 190 | # "public", "internal" or "admin". |
191 | # Defaults to $::os_service_default. | |
191 | # Defaults to $facts['os_service_default']. | |
192 | 192 | # |
193 | 193 | # [*params*] |
194 | 194 | # (Optional) Hash of additional parameters to pass through to the keystone |
196 | 196 | # |
197 | 197 | class gnocchi::keystone::authtoken( |
198 | 198 | $username = 'gnocchi', |
199 | $password = $::os_service_default, | |
199 | $password = $facts['os_service_default'], | |
200 | 200 | $auth_url = 'http://localhost:5000', |
201 | 201 | $project_name = 'services', |
202 | 202 | $user_domain_name = 'Default', |
203 | 203 | $project_domain_name = 'Default', |
204 | $system_scope = $::os_service_default, | |
205 | $insecure = $::os_service_default, | |
206 | $auth_section = $::os_service_default, | |
204 | $system_scope = $facts['os_service_default'], | |
205 | $insecure = $facts['os_service_default'], | |
206 | $auth_section = $facts['os_service_default'], | |
207 | 207 | $auth_type = 'password', |
208 | 208 | $www_authenticate_uri = 'http://localhost:5000', |
209 | $auth_version = $::os_service_default, | |
210 | $cache = $::os_service_default, | |
211 | $cafile = $::os_service_default, | |
212 | $certfile = $::os_service_default, | |
213 | $delay_auth_decision = $::os_service_default, | |
214 | $enforce_token_bind = $::os_service_default, | |
215 | $http_connect_timeout = $::os_service_default, | |
216 | $http_request_max_retries = $::os_service_default, | |
217 | $include_service_catalog = $::os_service_default, | |
218 | $keyfile = $::os_service_default, | |
219 | $memcache_pool_conn_get_timeout = $::os_service_default, | |
220 | $memcache_pool_dead_retry = $::os_service_default, | |
221 | $memcache_pool_maxsize = $::os_service_default, | |
222 | $memcache_pool_socket_timeout = $::os_service_default, | |
223 | $memcache_pool_unused_timeout = $::os_service_default, | |
224 | $memcache_secret_key = $::os_service_default, | |
225 | $memcache_security_strategy = $::os_service_default, | |
226 | $memcache_use_advanced_pool = $::os_service_default, | |
227 | $memcached_servers = $::os_service_default, | |
209 | $auth_version = $facts['os_service_default'], | |
210 | $cache = $facts['os_service_default'], | |
211 | $cafile = $facts['os_service_default'], | |
212 | $certfile = $facts['os_service_default'], | |
213 | $delay_auth_decision = $facts['os_service_default'], | |
214 | $enforce_token_bind = $facts['os_service_default'], | |
215 | $http_connect_timeout = $facts['os_service_default'], | |
216 | $http_request_max_retries = $facts['os_service_default'], | |
217 | $include_service_catalog = $facts['os_service_default'], | |
218 | $keyfile = $facts['os_service_default'], | |
219 | $memcache_pool_conn_get_timeout = $facts['os_service_default'], | |
220 | $memcache_pool_dead_retry = $facts['os_service_default'], | |
221 | $memcache_pool_maxsize = $facts['os_service_default'], | |
222 | $memcache_pool_socket_timeout = $facts['os_service_default'], | |
223 | $memcache_pool_unused_timeout = $facts['os_service_default'], | |
224 | $memcache_secret_key = $facts['os_service_default'], | |
225 | $memcache_security_strategy = $facts['os_service_default'], | |
226 | $memcache_use_advanced_pool = $facts['os_service_default'], | |
227 | $memcached_servers = $facts['os_service_default'], | |
228 | 228 | $manage_memcache_package = false, |
229 | $region_name = $::os_service_default, | |
230 | $token_cache_time = $::os_service_default, | |
231 | $service_token_roles = $::os_service_default, | |
232 | $service_token_roles_required = $::os_service_default, | |
233 | $service_type = $::os_service_default, | |
234 | $interface = $::os_service_default, | |
229 | $region_name = $facts['os_service_default'], | |
230 | $token_cache_time = $facts['os_service_default'], | |
231 | $service_token_roles = $facts['os_service_default'], | |
232 | $service_token_roles_required = $facts['os_service_default'], | |
233 | $service_type = $facts['os_service_default'], | |
234 | $interface = $facts['os_service_default'], | |
235 | 235 | $params = {} |
236 | 236 | ) { |
237 | 237 |
5 | 5 | # |
6 | 6 | # [*debug*] |
7 | 7 | # (Optional) Should the daemons log debug messages |
8 | # Defaults to $::os_service_default | |
8 | # Defaults to $facts['os_service_default'] | |
9 | 9 | # |
10 | 10 | # [*use_syslog*] |
11 | 11 | # (Optional) Use syslog for logging. |
12 | # Defaults to $::os_service_default | |
12 | # Defaults to $facts['os_service_default'] | |
13 | 13 | # |
14 | 14 | # [*use_json*] |
15 | 15 | # (Optional) Use json for logging. |
16 | # Defaults to $::os_service_default | |
16 | # Defaults to $facts['os_service_default'] | |
17 | 17 | # |
18 | 18 | # [*use_journal*] |
19 | 19 | # (Optional) Use journal for logging. |
20 | # Defaults to $::os_service_default | |
20 | # Defaults to $facts['os_service_default'] | |
21 | 21 | # |
22 | 22 | # [*use_stderr*] |
23 | 23 | # (Optional) Use stderr for logging |
24 | # Defaults to $::os_service_default | |
24 | # Defaults to $facts['os_service_default'] | |
25 | 25 | # |
26 | 26 | # [*log_facility*] |
27 | 27 | # (Optional) Syslog facility to receive log lines. |
28 | # Defaults to $::os_service_default | |
28 | # Defaults to $facts['os_service_default'] | |
29 | 29 | # |
30 | 30 | # [*log_dir*] |
31 | 31 | # (Optional) Directory where logs should be stored. |
32 | # If set to boolean false or the $::os_service_default, it will not log to | |
32 | # If set to boolean false or the $facts['os_service_default'], it will not log to | |
33 | 33 | # any directory. |
34 | 34 | # Defaults to '/var/log/gnocchi' |
35 | 35 | # |
36 | 36 | # [*log_file*] |
37 | 37 | # (Optional) File where logs should be stored. |
38 | # Defaults to $::os_service_default | |
38 | # Defaults to $facts['os_service_default'] | |
39 | 39 | # |
40 | 40 | # [*watch_log_file*] |
41 | 41 | # (Optional) Uses logging handler designed to watch file system (boolean value). |
42 | # Defaults to $::os_service_default | |
42 | # Defaults to $facts['os_service_default'] | |
43 | 43 | # |
44 | 44 | class gnocchi::logging( |
45 | $use_syslog = $::os_service_default, | |
46 | $use_json = $::os_service_default, | |
47 | $use_journal = $::os_service_default, | |
48 | $use_stderr = $::os_service_default, | |
49 | $log_facility = $::os_service_default, | |
45 | $use_syslog = $facts['os_service_default'], | |
46 | $use_json = $facts['os_service_default'], | |
47 | $use_journal = $facts['os_service_default'], | |
48 | $use_stderr = $facts['os_service_default'], | |
49 | $log_facility = $facts['os_service_default'], | |
50 | 50 | $log_dir = '/var/log/gnocchi', |
51 | $log_file = $::os_service_default, | |
52 | $watch_log_file = $::os_service_default, | |
53 | $debug = $::os_service_default, | |
51 | $log_file = $facts['os_service_default'], | |
52 | $watch_log_file = $facts['os_service_default'], | |
53 | $debug = $facts['os_service_default'], | |
54 | 54 | ) { |
55 | 55 | |
56 | 56 | include gnocchi::deps |
11 | 11 | # |
12 | 12 | # [*workers*] |
13 | 13 | # (optional) the number of workers. |
14 | # Defaults to $::os_workers | |
14 | # Defaults to $facts['os_workers'] | |
15 | 15 | # |
16 | 16 | # [*metric_processing_delay*] |
17 | 17 | # (optional) Delay between processing metrics |
18 | # Defaults to $::os_service_default. | |
18 | # Defaults to $facts['os_service_default']. | |
19 | 19 | # |
20 | 20 | # [*greedy*] |
21 | 21 | # (optional) Allow to bypass metric_processing_delay if metricd is noticed |
22 | 22 | # that messages are ready to be processed. |
23 | # Defaults to $::os_service_default. | |
23 | # Defaults to $facts['os_service_default']. | |
24 | 24 | # |
25 | 25 | # [*metric_reporting_delay*] |
26 | 26 | # (optional) How many seconds to wait between metric ingestion reporting. |
27 | # Defaults to $::os_service_default. | |
27 | # Defaults to $facts['os_service_default']. | |
28 | 28 | # |
29 | 29 | # [*metric_cleanup_delay*] |
30 | 30 | # (optional) How many seconds to wait between cleaning of expired data. |
31 | # Defaults to $::os_service_default. | |
31 | # Defaults to $facts['os_service_default']. | |
32 | 32 | # |
33 | 33 | # [*processing_replicas*] |
34 | 34 | # (optional) Number of workers tht share a task. |
35 | # Defaults to $::os_service_default. | |
35 | # Defaults to $facts['os_service_default']. | |
36 | 36 | # |
37 | 37 | # [*manage_service*] |
38 | 38 | # (optional) Whether the service should be managed by Puppet. |
41 | 41 | class gnocchi::metricd ( |
42 | 42 | $manage_service = true, |
43 | 43 | $enabled = true, |
44 | $workers = $::os_workers, | |
45 | $metric_processing_delay = $::os_service_default, | |
46 | $greedy = $::os_service_default, | |
47 | $metric_reporting_delay = $::os_service_default, | |
48 | $metric_cleanup_delay = $::os_service_default, | |
49 | $processing_replicas = $::os_service_default, | |
44 | $workers = $facts['os_workers'], | |
45 | $metric_processing_delay = $facts['os_service_default'], | |
46 | $greedy = $facts['os_service_default'], | |
47 | $metric_reporting_delay = $facts['os_service_default'], | |
48 | $metric_cleanup_delay = $facts['os_service_default'], | |
49 | $processing_replicas = $facts['os_service_default'], | |
50 | 50 | $package_ensure = 'present', |
51 | 51 | ) inherits gnocchi::params { |
52 | 52 |
18 | 18 | $gnocchi_wsgi_script_source = '/usr/bin/gnocchi-api' |
19 | 19 | $boto3_package_name = 'python3-boto3' |
20 | 20 | |
21 | case $::osfamily { | |
21 | case $facts['os']['family'] { | |
22 | 22 | 'RedHat': { |
23 | 23 | $sqlite_package_name = undef |
24 | 24 | $indexer_package_name = 'openstack-gnocchi-indexer-sqlalchemy' |
32 | 32 | $pymysql_package_name = 'python3-pymysql' |
33 | 33 | } |
34 | 34 | default: { |
35 | fail("Unsupported osfamily: ${::osfamily} operatingsystem") | |
35 | fail("Unsupported osfamily: ${facts['os']['family']}") | |
36 | 36 | } |
37 | 37 | |
38 | } # Case $::osfamily | |
38 | } # Case $facts['os']['family'] | |
39 | 39 | } |
5 | 5 | # |
6 | 6 | # [*enforce_scope*] |
7 | 7 | # (Optional) Whether or not to enforce scope when evaluating policies. |
8 | # Defaults to $::os_service_default. | |
8 | # Defaults to $facts['os_service_default']. | |
9 | 9 | # |
10 | 10 | # [*enforce_new_defaults*] |
11 | 11 | # (Optional) Whether or not to use old deprecated defaults when evaluating |
12 | 12 | # policies. |
13 | # Defaults to $::os_service_default. | |
13 | # Defaults to $facts['os_service_default']. | |
14 | 14 | # |
15 | 15 | # [*policies*] |
16 | 16 | # (Optional) Set of policies to configure for gnocchi |
33 | 33 | # |
34 | 34 | # [*policy_default_rule*] |
35 | 35 | # (Optional) Default rule. Enforced when a requested rule is not found. |
36 | # Defaults to $::os_service_default. | |
36 | # Defaults to $facts['os_service_default']. | |
37 | 37 | # |
38 | 38 | # [*policy_dirs*] |
39 | 39 | # (Optional) Path to the gnocchi policy folder |
40 | # Defaults to $::os_service_default | |
40 | # Defaults to $facts['os_service_default'] | |
41 | 41 | # |
42 | 42 | # [*purge_config*] |
43 | 43 | # (optional) Whether to set only the specified policy rules in the policy |
45 | 45 | # Defaults to false. |
46 | 46 | # |
47 | 47 | class gnocchi::policy ( |
48 | $enforce_scope = $::os_service_default, | |
49 | $enforce_new_defaults = $::os_service_default, | |
48 | $enforce_scope = $facts['os_service_default'], | |
49 | $enforce_new_defaults = $facts['os_service_default'], | |
50 | 50 | $policies = {}, |
51 | 51 | $policy_path = '/etc/gnocchi/policy.yaml', |
52 | $policy_default_rule = $::os_service_default, | |
53 | $policy_dirs = $::os_service_default, | |
52 | $policy_default_rule = $facts['os_service_default'], | |
53 | $policy_dirs = $facts['os_service_default'], | |
54 | 54 | $purge_config = false, |
55 | 55 | ) { |
56 | 56 |
6 | 6 | # |
7 | 7 | # [*host*] |
8 | 8 | # (optional) The listen IP for statsd. |
9 | # Defaults to $::os_service_default | |
9 | # Defaults to $facts['os_service_default'] | |
10 | 10 | # |
11 | 11 | # [*port*] |
12 | 12 | # (optional) The port for statsd. |
13 | # Defaults to $::os_service_default. | |
13 | # Defaults to $facts['os_service_default']. | |
14 | 14 | # |
15 | 15 | # [*flush_delay*] |
16 | 16 | # (optional) Delay between flushes. |
17 | # Defaults to $::os_service_default | |
17 | # Defaults to $facts['os_service_default'] | |
18 | 18 | # |
19 | 19 | # [*archive_policy_name*] |
20 | 20 | # (optional) Archive policy name to use when creating metrics. |
21 | # Defaults to $::os_service_default. | |
21 | # Defaults to $facts['os_service_default']. | |
22 | 22 | # |
23 | 23 | # [*creator*] |
24 | 24 | # (required) Creator value to use to identify statsd in Gnocchi. |
25 | # Defaults to $::os_service_default. | |
25 | # Defaults to $facts['os_service_default']. | |
26 | 26 | # |
27 | 27 | # [*enabled*] |
28 | 28 | # (optional) Should the service be enabled. |
38 | 38 | # |
39 | 39 | class gnocchi::statsd ( |
40 | 40 | $resource_id, |
41 | $host = $::os_service_default, | |
42 | $port = $::os_service_default, | |
43 | $flush_delay = $::os_service_default, | |
44 | $archive_policy_name = $::os_service_default, | |
45 | $creator = $::os_service_default, | |
41 | $host = $facts['os_service_default'], | |
42 | $port = $facts['os_service_default'], | |
43 | $flush_delay = $facts['os_service_default'], | |
44 | $archive_policy_name = $facts['os_service_default'], | |
45 | $creator = $facts['os_service_default'], | |
46 | 46 | $manage_service = true, |
47 | 47 | $enabled = true, |
48 | 48 | $package_ensure = 'present', |
25 | 25 | # |
26 | 26 | # [*ceph_keyring*] |
27 | 27 | # (optional) Ceph keyring path. |
28 | # Defaults to $::os_service_default | |
28 | # Defaults to $facts['os_service_default'] | |
29 | 29 | # |
30 | 30 | # [*ceph_secret*] |
31 | 31 | # (optional) Ceph secret. |
32 | # Defaults to $::os_service_default | |
32 | # Defaults to $facts['os_service_default'] | |
33 | 33 | # |
34 | 34 | # [*ceph_pool*] |
35 | 35 | # (optional) Ceph pool name to use. |
37 | 37 | # |
38 | 38 | # [*ceph_timeout*] |
39 | 39 | # (optional) Ceph connection timeout in seconds. |
40 | # Defaults to $::os_service_default | |
40 | # Defaults to $facts['os_service_default'] | |
41 | 41 | # |
42 | 42 | # [*ceph_conffile*] |
43 | 43 | # (optional) Ceph configuration file. |
53 | 53 | # |
54 | 54 | class gnocchi::storage::ceph( |
55 | 55 | $ceph_username, |
56 | $ceph_keyring = $::os_service_default, | |
57 | $ceph_secret = $::os_service_default, | |
56 | $ceph_keyring = $facts['os_service_default'], | |
57 | $ceph_secret = $facts['os_service_default'], | |
58 | 58 | $ceph_pool = 'gnocchi', |
59 | $ceph_timeout = $::os_service_default, | |
59 | $ceph_timeout = $facts['os_service_default'], | |
60 | 60 | $ceph_conffile = '/etc/ceph/ceph.conf', |
61 | 61 | $manage_rados = true, |
62 | 62 | $package_ensure = 'present', |
6 | 6 | # |
7 | 7 | # [*s3_endpoint_url*] |
8 | 8 | # (optional) 'S3 endpoint url. |
9 | # Defaults to $::os_service_default | |
9 | # Defaults to $facts['os_service_default'] | |
10 | 10 | # |
11 | 11 | # [*s3_region_name*] |
12 | 12 | # (optional) S3 Region name. |
13 | # Defaults to $::os_service_default | |
13 | # Defaults to $facts['os_service_default'] | |
14 | 14 | # |
15 | 15 | # [*s3_access_key_id*] |
16 | 16 | # (optional) S3 storage access key id. |
33 | 33 | # Defaults to 'present' |
34 | 34 | # |
35 | 35 | class gnocchi::storage::s3( |
36 | $s3_endpoint_url = $::os_service_default, | |
37 | $s3_region_name = $::os_service_default, | |
36 | $s3_endpoint_url = $facts['os_service_default'], | |
37 | $s3_region_name = $facts['os_service_default'], | |
38 | 38 | $s3_access_key_id = undef, |
39 | 39 | $s3_secret_access_key = undef, |
40 | $s3_bucket_prefix = $::os_service_default, | |
40 | $s3_bucket_prefix = $facts['os_service_default'], | |
41 | 41 | $manage_boto3 = true, |
42 | 42 | $package_ensure = 'present', |
43 | 43 | ) { |
22 | 22 | # |
23 | 23 | # [*swift_auth_version*] |
24 | 24 | # (optional) 'Swift authentication version to user. |
25 | # Defaults to $::os_service_default | |
25 | # Defaults to $facts['os_service_default'] | |
26 | 26 | # |
27 | 27 | # [*swift_authurl*] |
28 | 28 | # (optional) Swift auth URL. |
29 | # Defaults to $::os_service_default | |
29 | # Defaults to $facts['os_service_default'] | |
30 | 30 | # |
31 | 31 | # [*swift_user*] |
32 | 32 | # (optional) Swift user. |
33 | # Defaults to $::os_service_default | |
33 | # Defaults to $facts['os_service_default'] | |
34 | 34 | # |
35 | 35 | # [*swift_key*] |
36 | 36 | # (optional) Swift key. |
37 | # Defaults to $::os_service_default | |
37 | # Defaults to $facts['os_service_default'] | |
38 | 38 | # |
39 | 39 | # [*swift_project_name*] |
40 | 40 | # (optional) Swift tenant name, only used if swift_auth_version is '2' or |
41 | 41 | # '3'. |
42 | # Defaults to $::os_service_default | |
42 | # Defaults to $facts['os_service_default'] | |
43 | 43 | # |
44 | 44 | # [*swift_user_domain_name*] |
45 | 45 | # (optional) Swift user domain name. |
46 | # Defaults to $::os_service_default | |
46 | # Defaults to $facts['os_service_default'] | |
47 | 47 | # |
48 | 48 | # [*swift_project_domain_name*] |
49 | 49 | # (optional) Swift project domain name. |
50 | # Defaults to $::os_service_default | |
50 | # Defaults to $facts['os_service_default'] | |
51 | 51 | # |
52 | 52 | # [*swift_region*] |
53 | 53 | # (optional) Swift region. |
54 | # Defaults to $::os_service_default | |
54 | # Defaults to $facts['os_service_default'] | |
55 | 55 | # |
56 | 56 | # [*swift_endpoint_type*] |
57 | 57 | # (optional) Swift endpoint type. Defines the keystone endpoint type |
58 | 58 | # (publicURL, internalURL or adminURL). |
59 | # Defaults to $::os_service_default | |
59 | # Defaults to $facts['os_service_default'] | |
60 | 60 | # |
61 | 61 | # [*swift_service_type*] |
62 | 62 | # (optional) A string giving the service type of the swift service to use. |
63 | # Defaults to $::os_service_default | |
63 | # Defaults to $facts['os_service_default'] | |
64 | 64 | # |
65 | 65 | # [*swift_timeout*] |
66 | 66 | # (optional) Connection timeout in seconds. |
67 | # Defaults to $::os_service_default | |
67 | # Defaults to $facts['os_service_default'] | |
68 | 68 | # |
69 | 69 | class gnocchi::storage::swift( |
70 | $swift_auth_version = $::os_service_default, | |
71 | $swift_authurl = $::os_service_default, | |
72 | $swift_user = $::os_service_default, | |
73 | $swift_key = $::os_service_default, | |
74 | $swift_project_name = $::os_service_default, | |
75 | $swift_user_domain_name = $::os_service_default, | |
76 | $swift_project_domain_name = $::os_service_default, | |
77 | $swift_region = $::os_service_default, | |
78 | $swift_endpoint_type = $::os_service_default, | |
79 | $swift_service_type = $::os_service_default, | |
80 | $swift_timeout = $::os_service_default, | |
70 | $swift_auth_version = $facts['os_service_default'], | |
71 | $swift_authurl = $facts['os_service_default'], | |
72 | $swift_user = $facts['os_service_default'], | |
73 | $swift_key = $facts['os_service_default'], | |
74 | $swift_project_name = $facts['os_service_default'], | |
75 | $swift_user_domain_name = $facts['os_service_default'], | |
76 | $swift_project_domain_name = $facts['os_service_default'], | |
77 | $swift_region = $facts['os_service_default'], | |
78 | $swift_endpoint_type = $facts['os_service_default'], | |
79 | $swift_service_type = $facts['os_service_default'], | |
80 | $swift_timeout = $facts['os_service_default'], | |
81 | 81 | ) { |
82 | 82 | |
83 | 83 | include gnocchi::deps |
25 | 25 | # |
26 | 26 | # [*servername*] |
27 | 27 | # (Optional) The servername for the virtualhost. |
28 | # Defaults to $::fqdn | |
28 | # Defaults to $facts['networking']['fqdn'] | |
29 | 29 | # |
30 | 30 | # [*port*] |
31 | 31 | # (Optional) The port. |
45 | 45 | # |
46 | 46 | # [*workers*] |
47 | 47 | # (Optional) Number of WSGI workers to spawn. |
48 | # Defaults to $::os_workers | |
48 | # Defaults to $facts['os_workers'] | |
49 | 49 | # |
50 | 50 | # [*priority*] |
51 | 51 | # (Optional) The priority for the vhost. |
131 | 131 | # class { 'gnocchi::wsgi::apache': } |
132 | 132 | # |
133 | 133 | class gnocchi::wsgi::apache ( |
134 | $servername = $::fqdn, | |
134 | $servername = $facts['networking']['fqdn'], | |
135 | 135 | $port = 8041, |
136 | 136 | $bind_host = undef, |
137 | 137 | $path = '/', |
138 | 138 | $ssl = false, |
139 | $workers = $::os_workers, | |
139 | $workers = $facts['os_workers'], | |
140 | 140 | $ssl_cert = undef, |
141 | 141 | $ssl_key = undef, |
142 | 142 | $ssl_chain = undef, |
10 | 10 | # |
11 | 11 | # [*processes*] |
12 | 12 | # (Optional) Number of processes. |
13 | # Defaults to $::os_workers. | |
13 | # Defaults to $facts['os_workers']. | |
14 | 14 | # |
15 | 15 | # [*threads*] |
16 | 16 | # (Optional) Number of threads. |
21 | 21 | # Defaults to 100 |
22 | 22 | # |
23 | 23 | class gnocchi::wsgi::uwsgi ( |
24 | $processes = $::os_workers, | |
24 | $processes = $facts['os_workers'], | |
25 | 25 | $threads = 32, |
26 | 26 | $listen_queue_size = 100, |
27 | 27 | ){ |
28 | 28 | |
29 | 29 | include gnocchi::deps |
30 | 30 | |
31 | if $::operatingsystem != 'Debian'{ | |
31 | if $facts['os']['name'] != 'Debian'{ | |
32 | 32 | warning('This class is only valid for Debian, as other operating systems are not using uwsgi by default.') |
33 | 33 | } |
34 | 34 |
197 | 197 | }).each do |os,facts| |
198 | 198 | context "on #{os}" do |
199 | 199 | let (:facts) do |
200 | facts.merge!(OSDefaults.get_facts({ | |
201 | :concat_basedir => '/var/lib/puppet/concat', | |
202 | })) | |
200 | facts.merge!(OSDefaults.get_facts()) | |
203 | 201 | end |
204 | 202 | |
205 | 203 | let(:platform_params) do |
206 | case facts[:osfamily] | |
204 | case facts[:os]['family'] | |
207 | 205 | when 'Debian' |
208 | 206 | package_name = 'gnocchi-api' |
209 | 207 | when 'RedHat' |
22 | 22 | end |
23 | 23 | |
24 | 24 | let(:platform_params) do |
25 | case facts[:osfamily] | |
25 | case facts[:os]['family'] | |
26 | 26 | when 'Debian' |
27 | 27 | { :client_package_name => 'python3-gnocchiclient' } |
28 | 28 | when 'RedHat' |
110 | 110 | end |
111 | 111 | |
112 | 112 | let(:platform_params) do |
113 | case facts[:osfamily] | |
113 | case facts[:os]['family'] | |
114 | 114 | when 'Debian' |
115 | 115 | { |
116 | 116 | :pymysql_package_name => 'python3-pymysql', |
119 | 119 | end |
120 | 120 | |
121 | 121 | it_behaves_like 'gnocchi::db' |
122 | it_behaves_like "gnocchi::db on #{facts[:osfamily]}" | |
122 | it_behaves_like "gnocchi::db on #{facts[:os]['family']}" | |
123 | 123 | end |
124 | 124 | end |
125 | 125 | end |
53 | 53 | }).each do |os,facts| |
54 | 54 | context "on #{os}" do |
55 | 55 | let (:facts) do |
56 | facts.merge(OSDefaults.get_facts({ | |
57 | :os_workers => 8, | |
58 | :concat_basedir => '/var/lib/puppet/concat' | |
59 | })) | |
56 | facts.merge(OSDefaults.get_facts()) | |
60 | 57 | end |
61 | 58 | |
62 | 59 | it_configures 'gnocchi-dbsync' |
66 | 66 | end |
67 | 67 | |
68 | 68 | let(:platform_params) do |
69 | case facts[:osfamily] | |
69 | case facts[:os]['family'] | |
70 | 70 | when 'Debian' |
71 | 71 | { :gnocchi_common_package => 'gnocchi-common' } |
72 | 72 | when 'RedHat' |
65 | 65 | end |
66 | 66 | |
67 | 67 | let(:platform_params) do |
68 | case facts[:osfamily] | |
68 | case facts[:os]['family'] | |
69 | 69 | when 'Debian' |
70 | 70 | { :boto3_package_name => 'python3-boto3' } |
71 | 71 | when 'RedHat' |
9 | 9 | :group => 'gnocchi', |
10 | 10 | :path => '/', |
11 | 11 | :priority => 10, |
12 | :servername => facts[:fqdn], | |
12 | :servername => 'foo.example.com', | |
13 | 13 | :ssl => false, |
14 | 14 | :threads => 1, |
15 | 15 | :user => 'gnocchi', |
148 | 148 | context "on #{os}" do |
149 | 149 | let (:facts) do |
150 | 150 | facts.merge!(OSDefaults.get_facts({ |
151 | :os_workers => 4, | |
152 | :concat_basedir => '/var/lib/puppet/concat', | |
153 | :fqdn => 'some.host.tld', | |
151 | :os_workers => 4, | |
154 | 152 | })) |
155 | 153 | end |
156 | 154 | |
157 | 155 | let(:platform_params) do |
158 | case facts[:osfamily] | |
156 | case facts[:os]['family'] | |
159 | 157 | when 'Debian' |
160 | 158 | { |
161 | 159 | :wsgi_script_path => '/usr/lib/cgi-bin/gnocchi', |