From 46b552b1dc380513b17b67c2d9de2d4969eb0bfb Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 21 Feb 2022 01:16:08 +0900 Subject: [PATCH] Avoid hard-coding OS user/group in each manifest and replace hard-codes by definition in params.pp . Change-Id: I7f9267eef43a08f7cca12f1062ab532d96f1075f --- manifests/params.pp | 1 + manifests/plugins/ml2/nuage.pp | 2 +- manifests/plugins/nsx.pp | 2 +- manifests/plugins/nuage.pp | 2 +- manifests/plugins/opencontrail.pp | 2 +- manifests/wsgi/apache.pp | 4 ++-- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 23805e6c6..ca822790b 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -28,6 +28,7 @@ class neutron::params { $nsx_plugin_package = 'vmware-nsx' $nsx_config_file = '/etc/neutron/plugins/vmware/nsx.ini' $sfc_package = 'python3-networking-sfc' + $user = 'neutron' $group = 'neutron' $mlnx_agent_package = 'python3-networking-mlnx' $eswitchd_service = 'eswitchd' diff --git a/manifests/plugins/ml2/nuage.pp b/manifests/plugins/ml2/nuage.pp index 44f406c5b..5fb967426 100644 --- a/manifests/plugins/ml2/nuage.pp +++ b/manifests/plugins/ml2/nuage.pp @@ -84,7 +84,7 @@ class neutron::plugins::ml2::nuage ( file { '/etc/neutron/plugins/nuage/plugin.ini': ensure => file, owner => 'root', - group => 'neutron', + group => $::neutron::params::group, require => File['/etc/neutron/plugins/nuage'], mode => '0640', tag => 'neutron-config-file', diff --git a/manifests/plugins/nsx.pp b/manifests/plugins/nsx.pp index 71cdd1007..3f27e2bf1 100644 --- a/manifests/plugins/nsx.pp +++ b/manifests/plugins/nsx.pp @@ -98,7 +98,7 @@ class neutron::plugins::nsx ( file { $::neutron::params::nsx_config_file: ensure => file, owner => 'root', - group => 'neutron', + group => $::neutron::params::group, require => File['/etc/neutron/plugins/vmware'], mode => '0640', tag => 'neutron-config-file', diff --git a/manifests/plugins/nuage.pp b/manifests/plugins/nuage.pp index 16963912c..87e3c9a9d 100644 --- a/manifests/plugins/nuage.pp +++ b/manifests/plugins/nuage.pp @@ -81,7 +81,7 @@ class neutron::plugins::nuage ( file { '/etc/neutron/plugins/nuage/plugin.ini': ensure => file, owner => 'root', - group => 'neutron', + group => $::neutron::params::group, require => File['/etc/neutron/plugins/nuage'], mode => '0640', tag => 'neutron-config-file', diff --git a/manifests/plugins/opencontrail.pp b/manifests/plugins/opencontrail.pp index bf196d803..613efea2a 100644 --- a/manifests/plugins/opencontrail.pp +++ b/manifests/plugins/opencontrail.pp @@ -80,7 +80,7 @@ class neutron::plugins::opencontrail ( ensure_resource('file', '/etc/neutron/plugins/opencontrail', { ensure => directory, owner => 'root', - group => 'neutron', + group => $::neutron::params::group, mode => '0640'} ) diff --git a/manifests/wsgi/apache.pp b/manifests/wsgi/apache.pp index 88b71d5a6..dda7965a9 100644 --- a/manifests/wsgi/apache.pp +++ b/manifests/wsgi/apache.pp @@ -134,7 +134,7 @@ class neutron::wsgi::apache ( ::openstacklib::wsgi::apache { 'neutron_wsgi': bind_host => $bind_host, bind_port => $port, - group => 'neutron', + group => $::neutron::params::group, path => $path, priority => $priority, servername => $servername, @@ -147,7 +147,7 @@ class neutron::wsgi::apache ( ssl_crl_path => $ssl_crl_path, ssl_key => $ssl_key, threads => $threads, - user => 'neutron', + user => $::neutron::params::user, workers => $workers, wsgi_daemon_process => 'neutron', wsgi_process_display_name => $wsgi_process_display_name,