puppet-nova/manifests/compute/image_cache.pp
Takashi Kajinami 76a91ab0e1 Add support for image_cache options
This patch introduces a new class named nova::compute::image_cache,
to support parameters in image_cache sections, which were recently
added into nova[1].

[1] 828e8047e5c8651ea757bda7922670889d5e8818

Change-Id: I61d81667e4c58b62c453e37072d9aef461923b46
2020-10-11 15:45:07 +09:00

64 lines
2.5 KiB
Puppet

# == Class: nova::compute::image_cache
#
# Configures image caching in nova
#
# === Parameters:
#
# [*manager_interval*]
# (optional) Number of seconds to wait between runs of the image cache manager.
# Defaults to $::os_service_default
#
# [*subdirectory_name*]
# (optional) Location of cached images.
# Defaults to $::os_service_default
#
# [*remove_unused_base_images*]
# (optional) Should unused base images be removed?
# Defaults to $::os_service_default
#
# [*remove_unused_original_minimum_age_seconds*]
# (optional) Unused unresized base images younger than this will not be removed.
# Defaults to $::os_service_default
#
# [*remove_unused_resized_minimum_age_seconds*]
# (optional) Unused resized base images younger than this will not be removed.
# Defaults to $::os_service_default
#
# [*precache_concurrency*]
# (optional) Maximum number of compute hosts to trigger image precaching
# in parallel.
# Defaults to $::os_service_default
#
class nova::compute::image_cache (
$manager_interval = $::os_service_default,
$subdirectory_name = $::os_service_default,
$remove_unused_base_images = $::os_service_default,
$remove_unused_original_minimum_age_seconds = $::os_service_default,
$remove_unused_resized_minimum_age_seconds = $::os_service_default,
$precache_concurrency = $::os_service_default
) {
include nova::deps
$remove_unused_base_images_real = pick(
$::nova::compute::libvirt::remove_unused_base_images,
$remove_unused_base_images)
$remove_unused_original_minimum_age_seconds_real = pick(
$::nova::compute::libvirt::remove_unused_original_minimum_age_seconds,
$remove_unused_original_minimum_age_seconds)
$remove_unused_resized_minimum_age_seconds_real = pick(
$::nova::compute::libvirt::remove_unused_resized_minimum_age_seconds,
$remove_unused_resized_minimum_age_seconds)
nova_config {
'image_cache/manager_interval': value => $manager_interval;
'image_cache/subdirectory_name': value => $subdirectory_name;
'image_cache/remove_unused_base_images': value => $remove_unused_base_images_real;
'image_cache/remove_unused_original_minimum_age_seconds': value => $remove_unused_original_minimum_age_seconds_real;
'image_cache/remove_unused_resized_minimum_age_seconds': value => $remove_unused_resized_minimum_age_seconds_real;
'image_cache/precache_concurrency': value => $precache_concurrency;
}
}