Skip to content

Commit 9cb3885

Browse files
author
Emilien Macchi
committed
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 <emilien.macchi@enovance.com> (cherry picked from commit 00ed613)
1 parent 109d482 commit 9cb3885

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

manifests/keystone/auth.pp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
# (optional) The name of the nova service user
1212
# Defaults to 'nova'
1313
#
14+
# [*auth_name_v3*]
15+
# (optional) The name of the nova v3 service user
16+
# Defaults to 'novav3'
17+
#
1418
# [*public_address*]
1519
# (optional) The public nova-api endpoint
1620
# Defaults to '127.0.0.1'
@@ -55,6 +59,10 @@
5559
# (optional) Whether to create the endpoint.
5660
# Defaults to true
5761
#
62+
# [*configure_endpoint_v3*]
63+
# (optional) Whether to create the v3 endpoint.
64+
# Defaults to true
65+
#
5866
# [*cinder*]
5967
# (optional) Deprecated and has no effect
6068
# Defaults to undef
@@ -72,6 +80,7 @@
7280
class nova::keystone::auth(
7381
$password,
7482
$auth_name = 'nova',
83+
$auth_name_v3 = 'novav3',
7584
$public_address = '127.0.0.1',
7685
$admin_address = '127.0.0.1',
7786
$internal_address = '127.0.0.1',
@@ -85,6 +94,7 @@
8594
$cinder = undef,
8695
$public_protocol = 'http',
8796
$configure_endpoint = true,
97+
$configure_endpoint_v3 = true,
8898
$admin_protocol = 'http',
8999
$internal_protocol = 'http'
90100
) {
@@ -110,6 +120,11 @@
110120
type => 'compute',
111121
description => 'Openstack Compute Service',
112122
}
123+
keystone_service { $auth_name_v3:
124+
ensure => present,
125+
type => 'computev3',
126+
description => 'Openstack Compute Service v3',
127+
}
113128

114129
if $configure_endpoint {
115130
keystone_endpoint { "${region}/${auth_name}":
@@ -120,6 +135,15 @@
120135
}
121136
}
122137

138+
if $configure_endpoint_v3 {
139+
keystone_endpoint { "${region}/${auth_name_v3}":
140+
ensure => present,
141+
public_url => "${public_protocol}://${public_address}:${compute_port}/v3",
142+
admin_url => "${admin_protocol}://${admin_address}:${compute_port}/v3",
143+
internal_url => "${internal_protocol}://${internal_address}:${compute_port}/v3",
144+
}
145+
}
146+
123147
if $configure_ec2_endpoint {
124148
keystone_service { "${auth_name}_ec2":
125149
ensure => present,

spec/classes/nova_keystone_endpoint_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
:description => 'Openstack Compute Service'
2525
)}
2626

27+
it { should contain_keystone_service('novav3').with(
28+
:ensure => 'present',
29+
:type => 'computev3',
30+
:description => 'Openstack Compute Service v3'
31+
)}
32+
2733
it { should contain_keystone_service('nova_ec2').with(
2834
:ensure => 'present',
2935
:type => 'ec2',
@@ -37,6 +43,13 @@
3743
:internal_url => 'http://127.0.0.1:8774/v2/%(tenant_id)s'
3844
)}
3945

46+
it { should contain_keystone_endpoint('RegionOne/novav3').with(
47+
:ensure => 'present',
48+
:public_url => 'http://127.0.0.1:8774/v3',
49+
:admin_url => 'http://127.0.0.1:8774/v3',
50+
:internal_url => 'http://127.0.0.1:8774/v3'
51+
)}
52+
4053
it { should contain_keystone_endpoint('RegionOne/nova_ec2').with(
4154
:ensure => 'present',
4255
:public_url => 'http://127.0.0.1:8773/services/Cloud',

0 commit comments

Comments
 (0)