From acb97eff1edc7076fe85f1c2eb4a2e5d477aac34 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 21 Feb 2022 01:51:16 +0900 Subject: [PATCH] Avoid hard-coding OS user/group in each manifest and replace hard-codes by definition in params.pp . Change-Id: I718e97030f67ab257295de6db04696726efd4f5f --- manifests/db/sync.pp | 3 ++- manifests/params.pp | 1 + manifests/wsgi/apache.pp | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/manifests/db/sync.pp b/manifests/db/sync.pp index 20d4fc6..ba9e3d2 100644 --- a/manifests/db/sync.pp +++ b/manifests/db/sync.pp @@ -18,11 +18,12 @@ class vitrage::db::sync( ) { include vitrage::deps + include vitrage::params exec { 'vitrage-db-sync': command => "vitrage-dbsync ${extra_params}", path => '/usr/bin', - user => 'vitrage', + user => $::vitrage::params::user, refreshonly => true, try_sleep => 5, tries => 10, diff --git a/manifests/params.pp b/manifests/params.pp index f8d2387..52344ab 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -7,6 +7,7 @@ class vitrage::params { $pyver3 = $::openstacklib::defaults::pyver3 $client_package_name = 'python3-vitrageclient' + $user = 'vitrage' $group = 'vitrage' case $::osfamily { diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index aef45f0..3d8867a 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -137,7 +137,7 @@ class vitrage::wsgi::apache ( ::openstacklib::wsgi::apache { 'vitrage_wsgi': bind_host => $bind_host, bind_port => $port, - group => 'vitrage', + group => $::vitrage::params::group, path => $path, priority => $priority, servername => $servername, @@ -150,7 +150,7 @@ class vitrage::wsgi::apache ( ssl_crl_path => $ssl_crl_path, ssl_key => $ssl_key, threads => $threads, - user => 'vitrage', + user => $::vitrage::params::user, workers => $workers, wsgi_daemon_process => 'vitrage', wsgi_process_group => 'vitrage',