Fix neutron conf for compute and nova_neutron resource

Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
Bogdan Dobrelya 2015-08-25 12:40:46 +02:00
parent 6251331f27
commit 2e78911e5c
4 changed files with 46 additions and 10 deletions

View File

@ -475,8 +475,20 @@ def setup_resources():
# NOTE(bogdando): changes nova config, so should notify nova compute service # NOTE(bogdando): changes nova config, so should notify nova compute service
nova_compute_libvirt_puppet = vr.create('nova_compute_libvirt_puppet', 'resources/nova_compute_libvirt_puppet', {})[0] nova_compute_libvirt_puppet = vr.create('nova_compute_libvirt_puppet', 'resources/nova_compute_libvirt_puppet', {})[0]
signals.connect(node2, nova_compute_libvirt_puppet) signals.connect(node2, nova_compute_libvirt_puppet)
# compute configuration for neutron, use http auth/endpoint protocols, keystone v2 auth hardcoded for the resource
nova_neutron_puppet = vr.create('nova_neutron_puppet', 'resources/nova_neutron_puppet', {})[0] nova_neutron_puppet = vr.create('nova_neutron_puppet', 'resources/nova_neutron_puppet', {})[0]
signals.connect(node2, nova_neutron_puppet) signals.connect(node2, nova_neutron_puppet)
signals.connect(neutron_server_puppet, nova_neutron_puppet, {
'auth_password': 'neutron_admin_password',
'auth_user': 'neutron_admin_username',
'auth_type': 'neutron_auth_strategy',
'auth_host': 'auth_host', 'auth_port': 'auth_port',
'auth_protocol': 'auth_protocol',
})
signals.connect(neutron_keystone_service_endpoint, nova_neutron_puppet, {
'internal_ip':'neutron_endpoint_host',
'internal_port':'neutron_endpoint_port',
})
# signals.connect(keystone_puppet, nova_network_puppet, {'ip': 'keystone_host', 'port': 'keystone_port'}) # signals.connect(keystone_puppet, nova_network_puppet, {'ip': 'keystone_host', 'port': 'keystone_port'})
# signals.connect(keystone_puppet, nova_keystone_service_endpoint, {'ip': 'keystone_host', 'admin_port': 'keystone_port', 'admin_token': 'admin_token'}) # signals.connect(keystone_puppet, nova_keystone_service_endpoint, {'ip': 'keystone_host', 'admin_port': 'keystone_port', 'admin_token': 'admin_token'})

View File

@ -32,6 +32,9 @@ source https://github.com/openstack/puppet-nova/blob/5.1.0/manifests/network/neu
``neutron_url`` ``neutron_url``
(optional) URL for connecting to the Neutron networking service. (optional) URL for connecting to the Neutron networking service.
Defaults to 'http://127.0.0.1:9696' Defaults to 'http://127.0.0.1:9696'
Note: for this resource it is decomposed to the
'neutron_endpoint_host', 'neutron_endpoint_port', 'neutron_endpoint_protocol' inputs
due to implementation limitations
``neutron_url_timeout`` ``neutron_url_timeout``
(optional) Timeout value for connecting to neutron in seconds. (optional) Timeout value for connecting to neutron in seconds.
@ -73,6 +76,9 @@ source https://github.com/openstack/puppet-nova/blob/5.1.0/manifests/network/neu
This is the Identity (keystone) admin API server IP and port value, This is the Identity (keystone) admin API server IP and port value,
and not the Identity service API IP and port. and not the Identity service API IP and port.
Defaults to 'http://127.0.0.1:35357/v2.0' Defaults to 'http://127.0.0.1:35357/v2.0'
Note: for this resource it is decomposed to the
'auth_host', 'auth_port', 'auth_protocol' inputs
due to implementation limitations
``network_api_class`` ``network_api_class``
(optional) The full class name of the network API class. (optional) The full class name of the network API class.

View File

@ -1,16 +1,21 @@
$resource = hiera($::resource_name) $resource = hiera($::resource_name)
$auth_host = $resource['input']['auth_host']['value']
$auth_port = $resource['input']['auth_port']['value']
$auth_protocol = $resource['input']['auth_protocol']['value']
$neutron_endpoint_host = $resource['input']['neutron_endpoint_host']['value']
$neutron_endpoint_port = $resource['input']['neutron_endpoint_port']['value']
$neutron_endpoint_protocol = $resource['input']['neutron_endpoint_protocol']['value']
$libvirt_vif_driver = $resource['input']['libvirt_vif_driver']['value'] $libvirt_vif_driver = $resource['input']['libvirt_vif_driver']['value']
$force_snat_range = $resource['input']['force_snat_range']['value'] $force_snat_range = $resource['input']['force_snat_range']['value']
$neutron_admin_password = $resource['input']['neutron_admin_password']['value'] $neutron_admin_password = $resource['input']['neutron_admin_password']['value']
$neutron_auth_strategy = $resource['input']['neutron_auth_strategy']['value'] $neutron_auth_strategy = $resource['input']['neutron_auth_strategy']['value']
$neutron_url = $resource['input']['neutron_url']['value']
$neutron_url_timeout = $resource['input']['neutron_url_timeout']['value'] $neutron_url_timeout = $resource['input']['neutron_url_timeout']['value']
$neutron_admin_tenant_name = $resource['input']['neutron_admin_tenant_name']['value'] $neutron_admin_tenant_name = $resource['input']['neutron_admin_tenant_name']['value']
$neutron_default_tenant_id = $resource['input']['neutron_default_tenant_id']['value'] $neutron_default_tenant_id = $resource['input']['neutron_default_tenant_id']['value']
$neutron_region_name = $resource['input']['neutron_region_name']['value'] $neutron_region_name = $resource['input']['neutron_region_name']['value']
$neutron_admin_username = $resource['input']['neutron_admin_username']['value'] $neutron_admin_username = $resource['input']['neutron_admin_username']['value']
$neutron_admin_auth_url = $resource['input']['neutron_admin_auth_url']['value']
$neutron_ovs_bridge = $resource['input']['neutron_ovs_bridge']['value'] $neutron_ovs_bridge = $resource['input']['neutron_ovs_bridge']['value']
$neutron_extension_sync_interval = $resource['input']['neutron_extension_sync_interval']['value'] $neutron_extension_sync_interval = $resource['input']['neutron_extension_sync_interval']['value']
$neutron_ca_certificates_file = $resource['input']['neutron_ca_certificates_file']['value'] $neutron_ca_certificates_file = $resource['input']['neutron_ca_certificates_file']['value']
@ -30,13 +35,13 @@ class { 'nova::compute::neutron':
class { 'nova::network::neutron': class { 'nova::network::neutron':
neutron_admin_password => $neutron_admin_password, neutron_admin_password => $neutron_admin_password,
neutron_auth_strategy => $neutron_auth_strategy, neutron_auth_strategy => $neutron_auth_strategy,
neutron_url => $neutron_url, neutron_url => "${neutron_endpoint_protocol}://${neutron_endpoint_host}:${neutron_endpoint_port}",
neutron_url_timeout => $neutron_url_timeout, neutron_url_timeout => $neutron_url_timeout,
neutron_admin_tenant_name => $neutron_admin_tenant_name, neutron_admin_tenant_name => $neutron_admin_tenant_name,
neutron_default_tenant_id => $neutron_default_tenant_id, neutron_default_tenant_id => $neutron_default_tenant_id,
neutron_region_name => $neutron_region_name, neutron_region_name => $neutron_region_name,
neutron_admin_username => $neutron_admin_username, neutron_admin_username => $neutron_admin_username,
neutron_admin_auth_url => $neutron_admin_auth_url, neutron_admin_auth_url => "${auth_protocol}://${auth_host}:${auth_port}/v2.0",
neutron_ovs_bridge => $neutron_ovs_bridge, neutron_ovs_bridge => $neutron_ovs_bridge,
neutron_extension_sync_interval => $neutron_extension_sync_interval, neutron_extension_sync_interval => $neutron_extension_sync_interval,
neutron_ca_certificates_file => $neutron_ca_certificates_file, neutron_ca_certificates_file => $neutron_ca_certificates_file,

View File

@ -3,6 +3,25 @@ handler: puppet
puppet_module: nova puppet_module: nova
version: 1.0.0 version: 1.0.0
input: input:
auth_host:
schema: str
value: 'localhost'
auth_port:
schema: int
value: 35357
auth_protocol:
schema: str
value: 'http'
neutron_endpoint_host:
schema: str
value: 'localhost'
neutron_endpoint_port:
schema: int
value: 9696
neutron_endpoint_protocol:
schema: str
value: 'http'
libvirt_vif_driver: libvirt_vif_driver:
schema: str schema: str
value: 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver' value: 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver'
@ -15,9 +34,6 @@ input:
neutron_auth_strategy: neutron_auth_strategy:
schema: str schema: str
value: 'keystone' value: 'keystone'
neutron_url:
schema: str
value: 'http://127.0.0.1:9696'
neutron_url_timeout: neutron_url_timeout:
schema: int schema: int
value: 30 value: 30
@ -33,9 +49,6 @@ input:
neutron_admin_username: neutron_admin_username:
schema: str schema: str
value: 'neutron' value: 'neutron'
neutron_admin_auth_url:
schema: str
value: 'http://127.0.0.1:35357/v2.0'
neutron_ovs_bridge: neutron_ovs_bridge:
schema: str schema: str
value: 'br-int' value: 'br-int'