From 6562ab43b55c1c49c6d8a274d5ebd2db08b9b92f Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Fri, 21 Nov 2014 11:09:56 -0500 Subject: [PATCH] Refactorise Keystone resources management Refactorise the code of Keystone resources management with backward compatibility since we don't modify the unit tests. Change-Id: I745bca89bfa588df9dbeddc875f0be49975f638f Implements: blueprint common-openstack-identity-resource --- manifests/keystone/auth.pp | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/manifests/keystone/auth.pp b/manifests/keystone/auth.pp index 1eb1c12..d808761 100644 --- a/manifests/keystone/auth.pp +++ b/manifests/keystone/auth.pp @@ -94,29 +94,19 @@ class tuskar::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 => 'Tuskar Management Service', + keystone::resource::service_identity { $auth_name: + configure_user => true, + configure_user_role => true, + configure_endpoint => $configure_endpoint, + service_type => $service_type, + service_description => 'Tuskar Management Service', + region => $region, + password => $password, + email => $email, + tenant => $tenant, + public_url => "${public_protocol}://${public_address}:${real_public_port}", + internal_url => "${internal_protocol}://${internal_address}:${port}", + admin_url => "${admin_protocol}://${admin_address}:${port}", } - if $configure_endpoint { - keystone_endpoint { "${region}/${auth_name}": - ensure => present, - public_url => "${public_protocol}://${public_address}:${real_public_port}", - internal_url => "${internal_protocol}://${internal_address}:${port}", - admin_url => "${admin_protocol}://${admin_address}:${port}", - } - - } }