Avoid hard-coding OS user/group in each manifest

and replace hard-codes by definition in params.pp .

Change-Id: I4fc49eab447ef2b7e4f0d6cbd75f193cff7719b9
This commit is contained in:
Takashi Kajinami 2022-02-20 19:39:39 +09:00
parent 37d5b04d78
commit e5cc108c00
4 changed files with 8 additions and 6 deletions

View File

@ -31,7 +31,7 @@
#
# [*user*]
# (optional) User with access to heat files.
# Defaults to 'heat'.
# Defaults to $::heat::params::user.
#
# [*age*]
# (optional) Age value for $age_type.
@ -54,11 +54,11 @@ class heat::cron::purge_deleted (
$month = '*',
$weekday = '*',
$maxdelay = 0,
$user = 'heat',
$user = $::heat::params::user,
$age = 1,
$age_type = 'days',
$destination = '/var/log/heat/heat-purge_deleted.log'
) {
) inherits heat::params {
if ! member(['days', 'hours', 'minutes', 'seconds'], $age_type) {
fail('age_type possible values are only days, hours, minutes, or seconds.')

View File

@ -19,11 +19,12 @@ class heat::db::sync(
) {
include heat::deps
include heat::params
exec { 'heat-dbsync':
command => "heat-manage ${extra_params} db_sync",
path => '/usr/bin',
user => 'heat',
user => $::heat::params::user,
refreshonly => true,
try_sleep => 5,
tries => 10,

View File

@ -6,6 +6,7 @@ class heat::params {
include openstacklib::defaults
$client_package_name = 'python3-heatclient'
$user = 'heat'
$group = 'heat'
case $::osfamily {

View File

@ -148,7 +148,7 @@ define heat::wsgi::apache (
::openstacklib::wsgi::apache { "heat_${title}_wsgi":
bind_host => $bind_host,
bind_port => $port,
group => 'heat',
group => $::heat::params::group,
path => $path,
priority => $priority,
servername => $servername,
@ -161,7 +161,7 @@ define heat::wsgi::apache (
ssl_crl_path => $ssl_crl_path,
ssl_key => $ssl_key,
threads => $threads,
user => 'heat',
user => $::heat::params::user,
workers => $workers,
wsgi_daemon_process => "heat_${title}",
wsgi_process_display_name => $wsgi_process_display_name,