puppet-zaqar/manifests/management/redis.pp
Takashi Kajinami 0cc6468f2b Ensure python-redis is install
The python-redis package is an optional dependency and needs to be
installed explicitly in Ubuntu or Debian. (The zaqar package in RDO
has additonal dependency to require python-redis now).

Change-Id: I5c768a4ed60909f2e764ed6a39c372814b50c58b
2024-04-08 18:35:04 +09:00

53 lines
1.5 KiB
Puppet

# == class: zaqar::management::redis
#
# [*uri*]
# (Required) Redis Connection URI.
#
# [*max_reconnect_attempts*]
# (Optional) Maximum number of times to retry an operation that failed due to
# a primary node failover.
# Defaults to $facts['os_service_default'].
#
# [*reconnect_sleep*]
# (Optional) Base sleep interval between attempts to reconnect after
# a primary node failover.
# Defaults to $facts['os_service_default'].
#
# [*package_ensure*]
# (Optional) Ensure state for package.
# Defaults to 'present'
#
# [*manage_package*]
# (Optional) Manage pyhton-redis package.
# Defaults to true
#
class zaqar::management::redis(
$uri,
$max_reconnect_attempts = $facts['os_service_default'],
$reconnect_sleep = $facts['os_service_default'],
$package_ensure = 'present',
Boolean $manage_package = true,
) {
include zaqar::deps
include zaqar::params
zaqar_config {
'drivers:management_store:redis/uri': value => $uri, secret => true;
'drivers:management_store:redis/max_reconnect_attempts': value => $max_reconnect_attempts;
'drivers:management_store:redis/reconnect_sleep': value => $reconnect_sleep;
}
if $manage_package {
ensure_packages('python-redis', {
name => $::zaqar::params::python_redis_package_name,
ensure => $package_ensure,
tag => ['openstack'],
})
Anchor['zaqar::install::begin']
-> Package<| name == $::oslo::params::python_redis_package_name |>
-> Anchor['zaqar::install::end']
}
}