Skip to content

Commit

Permalink
Add API v3 endpoint support
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Emilien Macchi committed May 8, 2014
1 parent 109d482 commit 9cb3885
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
24 changes: 24 additions & 0 deletions manifests/keystone/auth.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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',
Expand All @@ -85,6 +94,7 @@
$cinder = undef,
$public_protocol = 'http',
$configure_endpoint = true,
$configure_endpoint_v3 = true,
$admin_protocol = 'http',
$internal_protocol = 'http'
) {
Expand All @@ -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}":
Expand All @@ -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,
Expand Down
13 changes: 13 additions & 0 deletions spec/classes/nova_keystone_endpoint_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down

0 comments on commit 9cb3885

Please sign in to comment.