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
This commit is contained in:
Pranali Deore 2018-08-02 09:09:15 +05:30
parent dd67adb7b8
commit 2f80fa1b1a
2 changed files with 64 additions and 0 deletions

View File

@ -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) %>'),
}
}
}

View File

@ -0,0 +1,4 @@
---
features:
- Add support for configuring the metadata file used by
Glance Netapp NFS backend.