|
| 1 | +# Class nova::cache |
| 2 | +# |
| 3 | +# nova cache configuration |
| 4 | +# |
| 5 | +# == parameters |
| 6 | +# |
| 7 | +# [*config_prefix*] |
| 8 | +# (Optional) Prefix for building the configuration dictionary for |
| 9 | +# the cache region. This should not need to be changed unless there |
| 10 | +# is another dogpile.cache region with the same configuration name. |
| 11 | +# (string value) |
| 12 | +# Defaults to $::os_service_default |
| 13 | +# |
| 14 | +# [*expiration_time*] |
| 15 | +# (Optional) Default TTL, in seconds, for any cached item in the |
| 16 | +# dogpile.cache region. This applies to any cached method that |
| 17 | +# doesn't have an explicit cache expiration time defined for it. |
| 18 | +# (integer value) |
| 19 | +# Defaults to $::os_service_default |
| 20 | +# |
| 21 | +# [*backend*] |
| 22 | +# (Optional) Dogpile.cache backend module. It is recommended that |
| 23 | +# Memcache with pooling (oslo_cache.memcache_pool) or Redis |
| 24 | +# (dogpile.cache.redis) be used in production deployments. (string value) |
| 25 | +# Defaults to $::os_service_default |
| 26 | +# |
| 27 | +# [*backend_argument*] |
| 28 | +# (Optional) Arguments supplied to the backend module. Specify this option |
| 29 | +# once per argument to be passed to the dogpile.cache backend. |
| 30 | +# Example format: "<argname>:<value>". (list value) |
| 31 | +# Defaults to $::os_service_default |
| 32 | +# |
| 33 | +# [*proxies*] |
| 34 | +# (Optional) Proxy classes to import that will affect the way the |
| 35 | +# dogpile.cache backend functions. See the dogpile.cache documentation on |
| 36 | +# changing-backend-behavior. (list value) |
| 37 | +# Defaults to $::os_service_default |
| 38 | +# |
| 39 | +# [*enabled*] |
| 40 | +# (Optional) Global toggle for caching. (boolean value) |
| 41 | +# Defaults to $::os_service_default |
| 42 | +# |
| 43 | +# [*debug_cache_backend*] |
| 44 | +# (Optional) Extra debugging from the cache backend (cache keys, |
| 45 | +# get/set/delete/etc calls). This is only really useful if you need |
| 46 | +# to see the specific cache-backend get/set/delete calls with the keys/values. |
| 47 | +# Typically this should be left set to false. (boolean value) |
| 48 | +# Defaults to $::os_service_default |
| 49 | +# |
| 50 | +# [*memcache_servers*] |
| 51 | +# (Optional) Memcache servers in the format of "host:port". |
| 52 | +# (dogpile.cache.memcache and oslo_cache.memcache_pool backends only). |
| 53 | +# (list value) |
| 54 | +# Defaults to $::os_service_default |
| 55 | +# |
| 56 | +# [*memcache_dead_retry*] |
| 57 | +# (Optional) Number of seconds memcached server is considered dead before |
| 58 | +# it is tried again. (dogpile.cache.memcache and oslo_cache.memcache_pool |
| 59 | +# backends only). (integer value) |
| 60 | +# Defaults to $::os_service_default |
| 61 | +# |
| 62 | +# [*memcache_socket_timeout*] |
| 63 | +# (Optional) Timeout in seconds for every call to a server. |
| 64 | +# (dogpile.cache.memcache and oslo_cache.memcache_pool backends only). |
| 65 | +# (integer value) |
| 66 | +# Defaults to $::os_service_default |
| 67 | +# |
| 68 | +# [*memcache_pool_maxsize*] |
| 69 | +# (Optional) Max total number of open connections to every memcached server. |
| 70 | +# (oslo_cache.memcache_pool backend only). (integer value) |
| 71 | +# Defaults to $::os_service_default |
| 72 | +# |
| 73 | +# [*memcache_pool_unused_timeout*] |
| 74 | +# (Optional) Number of seconds a connection to memcached is held unused |
| 75 | +# in the pool before it is closed. (oslo_cache.memcache_pool backend only) |
| 76 | +# (integer value) |
| 77 | +# Defaults to $::os_service_default |
| 78 | +# |
| 79 | +# [*memcache_pool_connection_get_timeout*] |
| 80 | +# (Optional) Number of seconds that an operation will wait to get a memcache |
| 81 | +# client connection. (integer value) |
| 82 | +# Defaults to $::os_service_default |
| 83 | +# |
| 84 | +class nova::cache ( |
| 85 | + $config_prefix = $::os_service_default, |
| 86 | + $expiration_time = $::os_service_default, |
| 87 | + $backend = $::os_service_default, |
| 88 | + $backend_argument = $::os_service_default, |
| 89 | + $proxies = $::os_service_default, |
| 90 | + $enabled = $::os_service_default, |
| 91 | + $debug_cache_backend = $::os_service_default, |
| 92 | + $memcache_servers = $::os_service_default, |
| 93 | + $memcache_dead_retry = $::os_service_default, |
| 94 | + $memcache_socket_timeout = $::os_service_default, |
| 95 | + $memcache_pool_maxsize = $::os_service_default, |
| 96 | + $memcache_pool_unused_timeout = $::os_service_default, |
| 97 | + $memcache_pool_connection_get_timeout = $::os_service_default, |
| 98 | +) { |
| 99 | + |
| 100 | + include ::nova::deps |
| 101 | + |
| 102 | + nova_config { |
| 103 | + 'cache/config_prefix': value => $config_prefix; |
| 104 | + 'cache/expiration_time': value => $expiration_time; |
| 105 | + 'cache/backend': value => $backend; |
| 106 | + 'cache/backend_argument': value => join(any2array($backend_argument), ','); |
| 107 | + 'cache/proxies': value => join(any2array($proxies), ','); |
| 108 | + 'cache/enabled': value => $enabled; |
| 109 | + 'cache/debug_cache_backend': value => $debug_cache_backend; |
| 110 | + 'cache/memcache_servers': value => join(any2array($memcache_servers), ','); |
| 111 | + 'cache/memcache_dead_retry': value => $memcache_dead_retry; |
| 112 | + 'cache/memcache_socket_timeout': value => $memcache_socket_timeout; |
| 113 | + 'cache/memcache_pool_maxsize': value => $memcache_pool_maxsize; |
| 114 | + 'cache/memcache_pool_unused_timeout': value => $memcache_pool_unused_timeout; |
| 115 | + 'cache/memcache_pool_connection_get_timeout': value => $memcache_pool_connection_get_timeout; |
| 116 | + } |
| 117 | +} |
0 commit comments