Avoid hard-coding OS user/group in each manifest

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

Change-Id: I79e8a56052b97c72f935b0042a8716b48fae65c2
This commit is contained in:
Takashi Kajinami 2022-02-21 01:09:51 +09:00
parent a36a020f47
commit cbc8b3fa60
4 changed files with 12 additions and 11 deletions

View File

@ -36,7 +36,7 @@
#
# [*user*]
# (optional) User with access to manila files.
# Defaults to 'manila'.
# Defaults to $::manila::params::user.
#
# [*age*]
# (optional) Number of days prior to today for deletion,
@ -61,11 +61,11 @@ class manila::cron::db_purge (
$monthday = '*',
$month = '*',
$weekday = '*',
$user = 'manila',
$user = $::manila::params::user,
$age = 0,
$destination = '/var/log/manila/manila-rowsflush.log',
$maxdelay = 0,
) {
) inherits manila::params {
include manila::deps

View File

@ -11,13 +11,13 @@ class manila::db::sync(
$db_sync_timeout = 300,
) {
include manila::params
include manila::deps
include manila::params
exec { 'manila-manage db_sync':
command => $::manila::params::db_sync_command,
path => '/usr/bin',
user => 'manila',
user => $::manila::params::user,
refreshonly => true,
try_sleep => 5,
tries => 10,

View File

@ -5,10 +5,11 @@
class manila::params {
include openstacklib::defaults
$client_package = 'python3-manilaclient'
$db_sync_command = 'manila-manage db sync'
$lio_package_name = 'targetcli'
$group = 'manila'
$client_package = 'python3-manilaclient'
$db_sync_command = 'manila-manage db sync'
$lio_package_name = 'targetcli'
$user = 'manila'
$group = 'manila'
case $::osfamily {
'Debian': {

View File

@ -142,7 +142,7 @@ class manila::wsgi::apache (
::openstacklib::wsgi::apache { 'manila_wsgi':
bind_host => $bind_host,
bind_port => $port,
group => 'manila',
group => $::manila::params::group,
path => $path,
priority => $priority,
servername => $servername,
@ -155,7 +155,7 @@ class manila::wsgi::apache (
ssl_crl_path => $ssl_crl_path,
ssl_key => $ssl_key,
threads => $threads,
user => 'manila',
user => $::manila::params::user,
vhost_custom_fragment => $vhost_custom_fragment,
workers => $workers,
wsgi_daemon_process => 'manila-api',