From 9cb3885f96d7a257a6dd85d6113ee7761ba028ee Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Thu, 8 May 2014 00:20:06 +0200 Subject: [PATCH] Add API v3 endpoint support Nova API v3 is now by default in Icehouse. This patch aims to add the ability to create the endpoint or not. Change-Id: I66c6c9b439f8320cd56b6899d02bbe01b80f7243 Signed-off-by: Emilien Macchi (cherry picked from commit 00ed6139ec7346b7a1d9f42e94de72901006d089) --- manifests/keystone/auth.pp | 24 +++++++++++++++++++++ spec/classes/nova_keystone_endpoint_spec.rb | 13 +++++++++++ 2 files changed, 37 insertions(+) diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index 51e338adc..64d48166a 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -11,6 +11,10 @@ # (optional) The name of the nova service user # Defaults to 'nova' # +# [*auth_name_v3*] +# (optional) The name of the nova v3 service user +# Defaults to 'novav3' +# # [*public_address*] # (optional) The public nova-api endpoint # Defaults to '127.0.0.1' @@ -55,6 +59,10 @@ # (optional) Whether to create the endpoint. # Defaults to true # +# [*configure_endpoint_v3*] +# (optional) Whether to create the v3 endpoint. +# Defaults to true +# # [*cinder*] # (optional) Deprecated and has no effect # Defaults to undef @@ -72,6 +80,7 @@ class nova::keystone::auth( $password, $auth_name = 'nova', + $auth_name_v3 = 'novav3', $public_address = '127.0.0.1', $admin_address = '127.0.0.1', $internal_address = '127.0.0.1', @@ -85,6 +94,7 @@ $cinder = undef, $public_protocol = 'http', $configure_endpoint = true, + $configure_endpoint_v3 = true, $admin_protocol = 'http', $internal_protocol = 'http' ) { @@ -110,6 +120,11 @@ type => 'compute', description => 'Openstack Compute Service', } + keystone_service { $auth_name_v3: + ensure => present, + type => 'computev3', + description => 'Openstack Compute Service v3', + } if $configure_endpoint { keystone_endpoint { "${region}/${auth_name}": @@ -120,6 +135,15 @@ } } + if $configure_endpoint_v3 { + keystone_endpoint { "${region}/${auth_name_v3}": + ensure => present, + public_url => "${public_protocol}://${public_address}:${compute_port}/v3", + admin_url => "${admin_protocol}://${admin_address}:${compute_port}/v3", + internal_url => "${internal_protocol}://${internal_address}:${compute_port}/v3", + } + } + if $configure_ec2_endpoint { keystone_service { "${auth_name}_ec2": ensure => present, diff --git a/spec/classes/nova_keystone_endpoint_spec.rb b/spec/classes/nova_keystone_endpoint_spec.rb index 337673d2b..2910b6886 100644 --- a/spec/classes/nova_keystone_endpoint_spec.rb +++ b/spec/classes/nova_keystone_endpoint_spec.rb @@ -24,6 +24,12 @@ :description => 'Openstack Compute Service' )} + it { should contain_keystone_service('novav3').with( + :ensure => 'present', + :type => 'computev3', + :description => 'Openstack Compute Service v3' + )} + it { should contain_keystone_service('nova_ec2').with( :ensure => 'present', :type => 'ec2', @@ -37,6 +43,13 @@ :internal_url => 'http://127.0.0.1:8774/v2/%(tenant_id)s' )} + it { should contain_keystone_endpoint('RegionOne/novav3').with( + :ensure => 'present', + :public_url => 'http://127.0.0.1:8774/v3', + :admin_url => 'http://127.0.0.1:8774/v3', + :internal_url => 'http://127.0.0.1:8774/v3' + )} + it { should contain_keystone_endpoint('RegionOne/nova_ec2').with( :ensure => 'present', :public_url => 'http://127.0.0.1:8773/services/Cloud',