diff --git a/packstack/puppet/templates/cinder.pp b/packstack/puppet/templates/cinder.pp index ab1342de2..b53733bf2 100644 --- a/packstack/puppet/templates/cinder.pp +++ b/packstack/puppet/templates/cinder.pp @@ -23,6 +23,11 @@ class { '::cinder::volume': } class { '::cinder::client': } +$cinder_keystone_admin_username = hiera('CONFIG_KEYSTONE_ADMIN_USERNAME') +$cinder_keystone_admin_password = hiera('CONFIG_KEYSTONE_ADMIN_PW') +$cinder_keystone_auth_url = hiera('CONFIG_KEYSTONE_PUBLIC_URL') +$cinder_keystone_api = hiera('CONFIG_KEYSTONE_API_VERSION') + # Cinder::Type requires keystone credentials Cinder::Type { os_password => hiera('CONFIG_CINDER_KS_PW'), diff --git a/packstack/puppet/templates/cinder_gluster.pp b/packstack/puppet/templates/cinder_gluster.pp index 4ed6d7cac..9d7dd9b68 100644 --- a/packstack/puppet/templates/cinder_gluster.pp +++ b/packstack/puppet/templates/cinder_gluster.pp @@ -8,6 +8,21 @@ cinder::backend::glusterfs { 'gluster': glusterfs_shares_config => '/etc/cinder/glusterfs_shares.conf', } +# TO-DO: Remove this workaround as soon as bz#1239040 will be resolved +if $cinder_keystone_api == 'v3' { + Exec <| title == 'cinder type-create glusterfs' or title == 'cinder type-key glusterfs set volume_backend_name=gluster' |> { + environment => [ + "OS_USERNAME=${cinder_keystone_admin_username}", + "OS_PASSWORD=${cinder_keystone_admin_password}", + "OS_AUTH_URL=${cinder_keystone_auth_url}", + "OS_IDENTITY_API_VERSION=${cinder_keystone_api}", + "OS_PROJECT_NAME=admin", + "OS_USER_DOMAIN_NAME=Default", + "OS_PROJECT_DOMAIN_NAME=Default", + ], + } +} + cinder::type { 'glusterfs': set_key => 'volume_backend_name', set_value => 'gluster', diff --git a/packstack/puppet/templates/cinder_lvm.pp b/packstack/puppet/templates/cinder_lvm.pp index 56a74a4dd..22232f22f 100644 --- a/packstack/puppet/templates/cinder_lvm.pp +++ b/packstack/puppet/templates/cinder_lvm.pp @@ -85,6 +85,20 @@ cinder::backend::iscsi { 'lvm': } +# TO-DO: Remove this workaround as soon as bz#1239040 will be resolved +if $cinder_keystone_api == 'v3' { + Exec <| title == 'cinder type-create iscsi' or title == 'cinder type-key iscsi set volume_backend_name=lvm' |> { + environment => [ + "OS_USERNAME=${cinder_keystone_admin_username}", + "OS_PASSWORD=${cinder_keystone_admin_password}", + "OS_AUTH_URL=${cinder_keystone_auth_url}", + "OS_IDENTITY_API_VERSION=${cinder_keystone_api}", + "OS_PROJECT_NAME=admin", + "OS_USER_DOMAIN_NAME=Default", + "OS_PROJECT_DOMAIN_NAME=Default", + ], + } +} cinder::type { 'iscsi': set_key => 'volume_backend_name', diff --git a/packstack/puppet/templates/cinder_netapp.pp b/packstack/puppet/templates/cinder_netapp.pp index 20ebf844f..c8db57c89 100644 --- a/packstack/puppet/templates/cinder_netapp.pp +++ b/packstack/puppet/templates/cinder_netapp.pp @@ -125,6 +125,21 @@ elsif $netapp_storage_family == 'eseries' { package { 'iscsi-initiator-utils': ensure => present } } +# TO-DO: Remove this workaround as soon as bz#1239040 will be resolved +if $cinder_keystone_api == 'v3' { + Exec <| title == "cinder type-create ${netapp_backend_name}" or title == "cinder type-key ${netapp_backend_name} set volume_backend_name=${netapp_backend_name}" |> { + environment => [ + "OS_USERNAME=${cinder_keystone_admin_username}", + "OS_PASSWORD=${cinder_keystone_admin_password}", + "OS_AUTH_URL=${cinder_keystone_auth_url}", + "OS_IDENTITY_API_VERSION=${cinder_keystone_api}", + "OS_PROJECT_NAME=admin", + "OS_USER_DOMAIN_NAME=Default", + "OS_PROJECT_DOMAIN_NAME=Default", + ], + } +} + cinder::type { $netapp_backend_name: set_key => 'volume_backend_name', set_value => $netapp_backend_name, diff --git a/packstack/puppet/templates/cinder_nfs.pp b/packstack/puppet/templates/cinder_nfs.pp index 7d6a6b0c0..9f752d297 100644 --- a/packstack/puppet/templates/cinder_nfs.pp +++ b/packstack/puppet/templates/cinder_nfs.pp @@ -6,6 +6,21 @@ cinder::backend::nfs { 'nfs': nfs_shares_config => '/etc/cinder/nfs_shares.conf', } +# TO-DO: Remove this workaround as soon as bz#1239040 will be resolved +if $cinder_keystone_api == 'v3' { + Exec <| title == 'cinder type-create nfs' or title == 'cinder type-key nfs set volume_backend_name=nfs' |> { + environment => [ + "OS_USERNAME=${cinder_keystone_admin_username}", + "OS_PASSWORD=${cinder_keystone_admin_password}", + "OS_AUTH_URL=${cinder_keystone_auth_url}", + "OS_IDENTITY_API_VERSION=${cinder_keystone_api}", + "OS_PROJECT_NAME=admin", + "OS_USER_DOMAIN_NAME=Default", + "OS_PROJECT_DOMAIN_NAME=Default", + ], + } +} + cinder::type { 'nfs': set_key => 'volume_backend_name', set_value => 'nfs', diff --git a/packstack/puppet/templates/cinder_vmdk.pp b/packstack/puppet/templates/cinder_vmdk.pp index 7d9405fba..45087220d 100644 --- a/packstack/puppet/templates/cinder_vmdk.pp +++ b/packstack/puppet/templates/cinder_vmdk.pp @@ -4,6 +4,21 @@ cinder::backend::vmdk { 'vmdk': host_password => hiera('CONFIG_VCENTER_PASSWORD'), } +# TO-DO: Remove this workaround as soon as bz#1239040 will be resolved +if $cinder_keystone_api == 'v3' { + Exec <| title == 'cinder type-create vmdk' or title == 'cinder type-key vmdk set volume_backend_name=vmdk' |> { + environment => [ + "OS_USERNAME=${cinder_keystone_admin_username}", + "OS_PASSWORD=${cinder_keystone_admin_password}", + "OS_AUTH_URL=${cinder_keystone_auth_url}", + "OS_IDENTITY_API_VERSION=${cinder_keystone_api}", + "OS_PROJECT_NAME=admin", + "OS_USER_DOMAIN_NAME=Default", + "OS_PROJECT_DOMAIN_NAME=Default", + ], + } +} + cinder::type { 'vmdk': set_key => 'volume_backend_name', set_value => 'vmdk',