Merge "Remove all glance nfs changes from puppet-tripleo"
This commit is contained in:
commit
1d836c24fe
@ -1,80 +0,0 @@
|
||||
# Copyright 2016 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::glance::nfs_mount
|
||||
#
|
||||
# NFS mount for Glance image storage file backend
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*share*]
|
||||
# NFS share to mount, in 'IP:PATH' format.
|
||||
#
|
||||
# [*options*]
|
||||
# (Optional) NFS mount options. Defaults to
|
||||
# 'intr,context=system_u:object_r:glance_var_lib_t:s0'
|
||||
#
|
||||
# [*edit_fstab*]
|
||||
# (Optional) Whether to persist the mount info to fstab.
|
||||
# Defaults to true.
|
||||
#
|
||||
# [*fstab_fstype*]
|
||||
# (Optional) File system type to use in fstab for the mount.
|
||||
# Defaults to 'nfs4'.
|
||||
#
|
||||
# [*fstab_prepend_options*]
|
||||
# (Optional) Extra mount options for fstab (prepended to $options).
|
||||
# Defaults to 'bg', so that a potentially failed mount doesn't
|
||||
# prevent the machine from booting.
|
||||
#
|
||||
class tripleo::glance::nfs_mount (
|
||||
$share,
|
||||
$options = 'intr,context=system_u:object_r:glance_var_lib_t:s0',
|
||||
$edit_fstab = true,
|
||||
$fstab_fstype = 'nfs4',
|
||||
$fstab_prepend_options = '_netdev,bg'
|
||||
) {
|
||||
|
||||
$images_dir = '/var/lib/glance/images'
|
||||
|
||||
if $options and $options != '' {
|
||||
$options_part = "-o ${options}"
|
||||
} else {
|
||||
$options_part = ''
|
||||
}
|
||||
|
||||
if $fstab_prepend_options and $fstab_prepend_options != '' {
|
||||
$fstab_prepend_part = "${fstab_prepend_options},"
|
||||
} else {
|
||||
$fstab_prepend_part = ''
|
||||
}
|
||||
|
||||
file { $images_dir:
|
||||
ensure => directory,
|
||||
}
|
||||
-> exec { 'NFS mount for glance file backend':
|
||||
path => ['/usr/sbin', '/usr/bin'],
|
||||
command => "mount -t nfs '${share}' '${images_dir}' ${options_part}",
|
||||
unless => "mount | grep ' ${images_dir} '",
|
||||
}
|
||||
|
||||
if $edit_fstab {
|
||||
file_line { 'NFS for glance in fstab':
|
||||
ensure => present,
|
||||
line => "${share} ${images_dir} ${fstab_fstype} ${fstab_prepend_part}${options} 0 0",
|
||||
match => " ${images_dir} ",
|
||||
path => '/etc/fstab',
|
||||
}
|
||||
}
|
||||
}
|
@ -47,10 +47,6 @@
|
||||
# This is set by t-h-t.
|
||||
# Defaults to hiera('glance_api_network', undef)
|
||||
#
|
||||
# [*glance_nfs_enabled*]
|
||||
# (Optional) Whether to use NFS mount as 'file' backend storage location.
|
||||
# Defaults to false
|
||||
#
|
||||
# [*step*]
|
||||
# (Optional) The current step in deployment. See tripleo-heat-templates
|
||||
# for more details.
|
||||
@ -128,7 +124,6 @@ class tripleo::profile::base::glance::api (
|
||||
$enable_internal_tls = hiera('enable_internal_tls', false),
|
||||
$glance_backend = downcase(hiera('glance_backend', 'swift')),
|
||||
$glance_network = hiera('glance_api_network', undef),
|
||||
$glance_nfs_enabled = false,
|
||||
$step = Integer(hiera('step')),
|
||||
$oslomsg_rpc_proto = hiera('oslo_messaging_rpc_scheme', 'rabbit'),
|
||||
$oslomsg_rpc_hosts = any2array(hiera('oslo_messaging_rpc_node_names', undef)),
|
||||
@ -153,10 +148,6 @@ class tripleo::profile::base::glance::api (
|
||||
$sync_db = false
|
||||
}
|
||||
|
||||
if $step >= 1 and $glance_nfs_enabled {
|
||||
include ::tripleo::glance::nfs_mount
|
||||
}
|
||||
|
||||
if $step >= 4 or ($step >= 3 and $sync_db) {
|
||||
if $enable_internal_tls {
|
||||
if !$glance_network {
|
||||
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
deprecations:
|
||||
- |
|
||||
Glance nfs mount would run via ansible in t-h-t, since the common
|
||||
mount task has been added to host_prep_task for both containerized
|
||||
& baremetal case, puppet-tripleo glance nfs_mount.pp would no longer
|
||||
be used.
|
Loading…
Reference in New Issue
Block a user