From e1e0a1b56c37eb81d1bc657157726ee2de9c0b4c Mon Sep 17 00:00:00 2001 From: Javier Pena Date: Mon, 9 May 2016 16:08:23 +0200 Subject: [PATCH] Fix wsgi_user and wsgi_group in Red Hat platforms Commit da0cedce6f14f5c35e733ac345d8d862db11cd2b assumed that the user and group for Horizon in Red Hat platforms was 'dashboard', due to the following lines being present in openstack-dashboard.conf: WSGIDaemonProcess dashboard WSGIProcessGroup dashboard Actually, based on [1], this does not mean that, and the RPM packages do not create such user, so we should switch that to the apache user. [1] http://modwsgi.readthedocs.io/en/latest/configuration-directives/WSGIDaemonProcess.html Change-Id: I52766ac0521951cc8c857e51a61823410585bed5 --- manifests/params.pp | 4 ++-- manifests/wsgi/apache.pp | 10 ++-------- spec/classes/horizon_wsgi_apache_spec.rb | 4 ++-- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index c0a46ead..5cc4c6f5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -17,8 +17,8 @@ class horizon::params { $root_url = '/dashboard' $apache_user = 'apache' $apache_group = 'apache' - $wsgi_user = 'dashboard' - $wsgi_group = 'dashboard' + $wsgi_user = 'apache' + $wsgi_group = 'apache' $memcache_package = 'python-memcached' } 'Debian': { diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index ead85617..595c36fa 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -171,14 +171,8 @@ class horizon::wsgi::apache ( Package['horizon'] -> Package['httpd'] Concat[$::horizon::params::config_file] ~> Service['httpd'] - $unix_user = $::osfamily ? { - 'RedHat' => $::horizon::params::apache_user, - default => $::horizon::params::wsgi_user - } - $unix_group = $::osfamily ? { - 'RedHat' => $::horizon::params::apache_group, - default => $::horizon::params::wsgi_group, - } + $unix_user = $::horizon::params::wsgi_user + $unix_group = $::horizon::params::wsgi_group file { $::horizon::params::logdir: ensure => directory, diff --git a/spec/classes/horizon_wsgi_apache_spec.rb b/spec/classes/horizon_wsgi_apache_spec.rb index dc9c66fb..615703ee 100644 --- a/spec/classes/horizon_wsgi_apache_spec.rb +++ b/spec/classes/horizon_wsgi_apache_spec.rb @@ -200,8 +200,8 @@ describe 'horizon::wsgi::apache' do :root_url => '/dashboard', :apache_user => 'apache', :apache_group => 'apache', - :wsgi_user => 'dashboard', - :wsgi_group => 'dashboard', + :wsgi_user => 'apache', + :wsgi_group => 'apache', :unix_user => 'apache', :unix_group => 'apache' } end