Refactorise Keystone resources management

Refactorise the code of Keystone resources management with backward
compatibility since we don't modify the unit tests.

Change-Id: I1c130653a9594984dc59cc719e87bbfc40d88132
Implements: blueprint common-openstack-identity-resource
This commit is contained in:
Emilien Macchi 2014-11-21 10:28:40 -05:00
parent e6a2055fdc
commit a34629f956
1 changed files with 13 additions and 23 deletions

View File

@ -85,29 +85,19 @@ class ironic::keystone::auth (
$real_public_port = $public_port
}
keystone_user { $auth_name:
ensure => present,
password => $password,
email => $email,
tenant => $tenant,
}
keystone_user_role { "${auth_name}@${tenant}":
ensure => present,
roles => 'admin',
}
keystone_service { $auth_name:
ensure => present,
type => $service_type,
description => 'Ironic Networking Service',
keystone::resource::service_identity { $auth_name:
configure_user => true,
configure_user_role => true,
configure_endpoint => $configure_endpoint,
service_type => $service_type,
service_description => 'Ironic Networking Service',
region => $region,
password => $password,
email => $email,
tenant => $tenant,
public_url => "${public_protocol}://${public_address}:${real_public_port}/",
internal_url => "http://${internal_address}:${port}/",
admin_url => "http://${admin_address}:${port}/",
}
if $configure_endpoint {
keystone_endpoint { "${region}/${auth_name}":
ensure => present,
public_url => "${public_protocol}://${public_address}:${real_public_port}/",
internal_url => "http://${internal_address}:${port}/",
admin_url => "http://${admin_address}:${port}/",
}
}
}