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

View File

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

View File

@ -8,6 +8,7 @@ class manila::params {
$client_package = 'python3-manilaclient' $client_package = 'python3-manilaclient'
$db_sync_command = 'manila-manage db sync' $db_sync_command = 'manila-manage db sync'
$lio_package_name = 'targetcli' $lio_package_name = 'targetcli'
$user = 'manila'
$group = 'manila' $group = 'manila'
case $::osfamily { case $::osfamily {

View File

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