1 # == Class: neutron::agents::metadata
3 # Setup and configure Neutron metadata agent.
8 # (required) The password for the administrative user.
11 # (required) Shared secret to validate proxies Neutron metadata requests.
14 # Ensure state of the package. Defaults to 'present'.
17 # State of the service. Defaults to true.
20 # (optional) Whether to start/stop the service
24 # Debug. Defaults to false.
27 # The administrative user's tenant name. Defaults to 'services'.
30 # The administrative user name for OpenStack Networking.
31 # Defaults to 'neutron'.
34 # The URL used to validate tokens. Defaults to 'http://localhost:35357/v2.0'.
37 # turn off verification of the certificate for ssl (Defaults to false)
40 # CA cert to check against with for ssl keystone. (Defaults to undef)
43 # The authentication region. Defaults to 'RegionOne'.
46 # The IP address of the metadata service. Defaults to '127.0.0.1'.
49 # The TCP port of the metadata service. Defaults to 8775.
51 # [*metadata_workers*]
52 # (optional) Number of separate worker processes to spawn.
53 # The default, count of machine's processors, runs the worker thread in the
55 # Greater than 0 launches that number of child processes as workers.
56 # The parent process manages them. Having more workers will help to improve performances.
57 # Defaults to: $::processorcount
59 # [*metadata_backlog*]
60 # (optional) Number of backlog requests to configure the metadata server socket with.
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.
71 class neutron::agents::metadata (
74 $package_ensure = 'present',
76 $manage_service = true,
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,
91 include neutron::params
93 Package['neutron'] -> Neutron_metadata_agent_config<||>
94 Neutron_config<||> ~> Service['neutron-metadata']
95 Neutron_metadata_agent_config<||> ~> Service['neutron-metadata']
97 neutron_metadata_agent_config {
98 'DEFAULT/debug': value => $debug;
99 'DEFAULT/auth_url': value => $auth_url;
100 'DEFAULT/auth_insecure': value => $auth_insecure;
101 'DEFAULT/auth_region': value => $auth_region;
102 'DEFAULT/admin_tenant_name': value => $auth_tenant;
103 'DEFAULT/admin_user': value => $auth_user;
104 'DEFAULT/admin_password': value => $auth_password, secret => true;
105 'DEFAULT/nova_metadata_ip': value => $metadata_ip;
106 'DEFAULT/nova_metadata_port': value => $metadata_port;
107 'DEFAULT/metadata_proxy_shared_secret': value => $shared_secret;
108 'DEFAULT/metadata_workers': value => $metadata_workers;
109 'DEFAULT/metadata_backlog': value => $metadata_backlog;
112 if $metadata_memory_cache_ttl {
113 neutron_metadata_agent_config {
114 'DEFAULT/cache_url': value => "memory://?default_ttl=${metadata_memory_cache_ttl}";
117 neutron_metadata_agent_config {
118 'DEFAULT/cache_url': ensure => absent;
123 neutron_metadata_agent_config {
124 'DEFAULT/auth_ca_cert': value => $auth_ca_cert;
127 neutron_metadata_agent_config {
128 'DEFAULT/auth_ca_cert': ensure => absent;
132 if $::neutron::params::metadata_agent_package {
133 Package['neutron-metadata'] -> Neutron_metadata_agent_config<||>
134 Package['neutron-metadata'] -> Service['neutron-metadata']
135 package { 'neutron-metadata':
136 ensure => $package_ensure,
137 name => $::neutron::params::metadata_agent_package,
138 require => Package['neutron'],
144 $service_ensure = 'running'
146 $service_ensure = 'stopped'
150 service { 'neutron-metadata':
151 ensure => $service_ensure,
152 name => $::neutron::params::metadata_agent_service,
154 require => Class['neutron'],