|
60 | 60 | # (optional) Number of backlog requests to configure the metadata server socket with. |
61 | 61 | # Defaults to 4096 |
62 | 62 | # |
| 63 | +# [*metadata_memory_cache_ttl*] |
| 64 | +# (optional) Specifies time in seconds a metadata cache entry is valid in |
| 65 | +# memory caching backend. |
| 66 | +# Set to 0 will cause cache entries to never expire. |
| 67 | +# Set to undef or false to disable cache. |
| 68 | +# Defaults to 5 |
| 69 | +# |
63 | 70 |
|
64 | 71 | class neutron::agents::metadata ( |
65 | 72 | $auth_password, |
66 | 73 | $shared_secret, |
67 | | - $package_ensure = 'present', |
68 | | - $enabled = true, |
69 | | - $manage_service = true, |
70 | | - $debug = false, |
71 | | - $auth_tenant = 'services', |
72 | | - $auth_user = 'neutron', |
73 | | - $auth_url = 'http://localhost:35357/v2.0', |
74 | | - $auth_insecure = false, |
75 | | - $auth_ca_cert = undef, |
76 | | - $auth_region = 'RegionOne', |
77 | | - $metadata_ip = '127.0.0.1', |
78 | | - $metadata_port = '8775', |
79 | | - $metadata_workers = $::processorcount, |
80 | | - $metadata_backlog = '4096' |
| 74 | + $package_ensure = 'present', |
| 75 | + $enabled = true, |
| 76 | + $manage_service = true, |
| 77 | + $debug = false, |
| 78 | + $auth_tenant = 'services', |
| 79 | + $auth_user = 'neutron', |
| 80 | + $auth_url = 'http://localhost:35357/v2.0', |
| 81 | + $auth_insecure = false, |
| 82 | + $auth_ca_cert = undef, |
| 83 | + $auth_region = 'RegionOne', |
| 84 | + $metadata_ip = '127.0.0.1', |
| 85 | + $metadata_port = '8775', |
| 86 | + $metadata_workers = $::processorcount, |
| 87 | + $metadata_backlog = '4096', |
| 88 | + $metadata_memory_cache_ttl = 5, |
81 | 89 | ) { |
82 | 90 |
|
83 | 91 | include neutron::params |
|
101 | 109 | 'DEFAULT/metadata_backlog': value => $metadata_backlog; |
102 | 110 | } |
103 | 111 |
|
| 112 | + if $metadata_memory_cache_ttl { |
| 113 | + neutron_metadata_agent_config { |
| 114 | + 'DEFAULT/cache_url': value => "memory://?default_ttl=${metadata_memory_cache_ttl}"; |
| 115 | + } |
| 116 | + } else { |
| 117 | + neutron_metadata_agent_config { |
| 118 | + 'DEFAULT/cache_url': ensure => absent; |
| 119 | + } |
| 120 | + } |
| 121 | + |
104 | 122 | if $auth_ca_cert { |
105 | 123 | neutron_metadata_agent_config { |
106 | 124 | 'DEFAULT/auth_ca_cert': value => $auth_ca_cert; |
|
0 commit comments