From 2f80fa1b1a1af1bf32afb523193ba8fa2df60d15 Mon Sep 17 00:00:00 2001 From: Pranali Deore Date: Thu, 2 Aug 2018 09:09:15 +0530 Subject: [PATCH] Move metadata file creation of glance netapp to puppet-tripelo from THT Since, openstack-glance package has been removed from overcloud image during the cleanup, 'filesystem_store_metadata_file' file is failing to create on host in case of glance netapp. So, adding metadata file creation part in puppet-tripleo. Change-Id: I031a8921a74af137927ba83ee2307aafc13263cb --- manifests/profile/base/glance/netapp.pp | 60 +++++++++++++++++++ ...on-for-glance-netapp-47668bb602316024.yaml | 4 ++ 2 files changed, 64 insertions(+) create mode 100644 manifests/profile/base/glance/netapp.pp create mode 100644 releasenotes/notes/metadata-file-creation-for-glance-netapp-47668bb602316024.yaml diff --git a/manifests/profile/base/glance/netapp.pp b/manifests/profile/base/glance/netapp.pp new file mode 100644 index 000000000..ddd900bd0 --- /dev/null +++ b/manifests/profile/base/glance/netapp.pp @@ -0,0 +1,60 @@ +# Copyright 2018 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# == Class: tripleo::profile::base::glance::netapp +# +# Create metadata file for glance Netapp +# +# === Parameters +# +# [*netapp_share*] +# Netapp share to mount, in 'IP:PATH' format. +# +# [*netapp_nfs_mount*] +# (Optional) NFS mount point. +# Defaults to '/var/lib/glance/images' +# +# [*filesystem_store_metadata_file*] +# (optional) The path to a file which contains the metadata to be returned +# with any location associated with the filesystem store +# properties. +# Defaults to '/etc/glance/glance-metadata-file.json'. +# +# [*step*] +# (Optional) The current step in deployment. See tripleo-heat-templates +# for more details. +# Defaults to hiera('step') + +class tripleo::profile::base::glance::netapp ( + $netapp_share, + $netapp_nfs_mount = '/var/lib/glance/images', + $filesystem_store_metadata_file = '/etc/glance/glance-metadata-file.json', + $step = Integer(hiera('step')), +) { + + + if ($step >= 4) { + $netapp_share_location = sprintf('nfs://%s', regsubst($netapp_share, ':', '', 'G')) + $metadata = { + 'id' => 'TripleOGlanceNetapp', + 'share_location' => $netapp_share_location, + 'mountpoint' => $netapp_nfs_mount, + 'type' => 'nfs', } + file { $filesystem_store_metadata_file: + ensure => file, + content => inline_template('<%= require "json"; JSON.dump(@metadata) %>'), + } + } +} + diff --git a/releasenotes/notes/metadata-file-creation-for-glance-netapp-47668bb602316024.yaml b/releasenotes/notes/metadata-file-creation-for-glance-netapp-47668bb602316024.yaml new file mode 100644 index 000000000..5badfb49c --- /dev/null +++ b/releasenotes/notes/metadata-file-creation-for-glance-netapp-47668bb602316024.yaml @@ -0,0 +1,4 @@ +--- +features: + - Add support for configuring the metadata file used by + Glance Netapp NFS backend.