Avoid hard-coding OS user/group in each manifest
and replace hard-codes by definition in params.pp . Change-Id: Ic3ec6f43de5ac709bdba321f284581954c86297a
This commit is contained in:
parent
9123ac7270
commit
f2bb2a688b
@ -48,7 +48,7 @@
|
|||||||
#
|
#
|
||||||
# [*mount_user*]
|
# [*mount_user*]
|
||||||
# (optional) Mount user.
|
# (optional) Mount user.
|
||||||
# Defaults to: cinder
|
# Defaults to: $::cinder::params::user
|
||||||
#
|
#
|
||||||
# [*mount_group*]
|
# [*mount_group*]
|
||||||
# (optional) Mount group.
|
# (optional) Mount group.
|
||||||
@ -73,13 +73,16 @@ define cinder::backend::vstorage (
|
|||||||
$mount_point_base = $::os_service_default,
|
$mount_point_base = $::os_service_default,
|
||||||
$default_volume_format = $::os_service_default,
|
$default_volume_format = $::os_service_default,
|
||||||
$manage_volume_type = false,
|
$manage_volume_type = false,
|
||||||
$mount_user = 'cinder',
|
$mount_user = undef,
|
||||||
$mount_group = 'root',
|
$mount_group = 'root',
|
||||||
$mount_permissions = '0770',
|
$mount_permissions = '0770',
|
||||||
$manage_package = true,
|
$manage_package = true,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include cinder::deps
|
include cinder::deps
|
||||||
|
include cinder::params
|
||||||
|
|
||||||
|
$mount_user_real = pick($mount_user, $::cinder::params::user)
|
||||||
|
|
||||||
cinder_config {
|
cinder_config {
|
||||||
"${name}/volume_backend_name": value => $volume_backend_name;
|
"${name}/volume_backend_name": value => $volume_backend_name;
|
||||||
@ -110,12 +113,12 @@ define cinder::backend::vstorage (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$mount_opts = ['-u', $mount_user, '-g', $mount_group, '-m', $mount_permissions]
|
$mount_opts = ['-u', $mount_user_real, '-g', $mount_group, '-m', $mount_permissions]
|
||||||
|
|
||||||
file { $shares_config_path:
|
file { $shares_config_path:
|
||||||
content => inline_template("${cluster_name}:${cluster_password} <%= @mount_opts %>"),
|
content => inline_template("${cluster_name}:${cluster_password} <%= @mount_opts %>"),
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'cinder',
|
group => $::cinder::params::group,
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
require => Anchor['cinder::install::end'],
|
require => Anchor['cinder::install::end'],
|
||||||
notify => Anchor['cinder::service::begin'],
|
notify => Anchor['cinder::service::begin'],
|
||||||
|
@ -19,11 +19,12 @@ class cinder::db::sync(
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
include cinder::deps
|
include cinder::deps
|
||||||
|
include cinder::params
|
||||||
|
|
||||||
exec { 'cinder-manage db_sync':
|
exec { 'cinder-manage db_sync':
|
||||||
command => "cinder-manage ${extra_params} db sync",
|
command => "cinder-manage ${extra_params} db sync",
|
||||||
path => ['/bin', '/usr/bin'],
|
path => ['/bin', '/usr/bin'],
|
||||||
user => 'cinder',
|
user => $::cinder::params::user,
|
||||||
refreshonly => true,
|
refreshonly => true,
|
||||||
try_sleep => 5,
|
try_sleep => 5,
|
||||||
tries => 10,
|
tries => 10,
|
||||||
|
@ -6,6 +6,7 @@ class cinder::params {
|
|||||||
include openstacklib::defaults
|
include openstacklib::defaults
|
||||||
|
|
||||||
$client_package = 'python3-cinderclient'
|
$client_package = 'python3-cinderclient'
|
||||||
|
$user = 'cinder'
|
||||||
$group = 'cinder'
|
$group = 'cinder'
|
||||||
$cinder_wsgi_script_source = '/usr/bin/cinder-wsgi'
|
$cinder_wsgi_script_source = '/usr/bin/cinder-wsgi'
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ class cinder::wsgi::apache (
|
|||||||
::openstacklib::wsgi::apache { 'cinder_wsgi':
|
::openstacklib::wsgi::apache { 'cinder_wsgi':
|
||||||
bind_host => $bind_host,
|
bind_host => $bind_host,
|
||||||
bind_port => $port,
|
bind_port => $port,
|
||||||
group => 'cinder',
|
group => $::cinder::params::group,
|
||||||
path => $path,
|
path => $path,
|
||||||
priority => $priority,
|
priority => $priority,
|
||||||
servername => $servername,
|
servername => $servername,
|
||||||
@ -171,7 +171,7 @@ class cinder::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 => 'cinder',
|
user => $::cinder::params::user,
|
||||||
vhost_custom_fragment => $vhost_custom_fragment,
|
vhost_custom_fragment => $vhost_custom_fragment,
|
||||||
workers => $workers,
|
workers => $workers,
|
||||||
wsgi_daemon_process => 'cinder-api',
|
wsgi_daemon_process => 'cinder-api',
|
||||||
|
Loading…
Reference in New Issue
Block a user