From b3ff1ac9d4fea5a53ce246e1210be83fc7d65916 Mon Sep 17 00:00:00 2001 From: Ben Kero Date: Tue, 14 Jul 2015 19:56:34 +0000 Subject: [PATCH] Warn that object storage parameter mount_check changes next release The 'mount_check' parameter is different in this Puppet module than in Swift. This patch adds a warning() to tell the user that starting in the next version, the default will change to match the upstream default from False to True. Closes-Bug: 1265243 Change-Id: I7f98e523be2f8bbf39b70c544a1965c975c690dd Signed-off-by: Ben Kero --- manifests/storage/all.pp | 14 +++++++++++--- manifests/storage/server.pp | 14 +++++++++++--- templates/account-server.conf.erb | 2 +- templates/container-server.conf.erb | 2 +- templates/object-server.conf.erb | 2 +- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/manifests/storage/all.pp b/manifests/storage/all.pp index de2ce24c..15cab6f2 100644 --- a/manifests/storage/all.pp +++ b/manifests/storage/all.pp @@ -36,7 +36,7 @@ # [*mount_check*] # (optional) Whether or not check if the devices are mounted # to prevent accidentally writing to the root device -# Defaults to false +# Defaults to false. Soon to be changed to 'true' to match Swift defaults. # # [*account_pipeline*] # (optional) Specify the account pipeline @@ -67,7 +67,7 @@ class swift::storage::all( $object_pipeline = undef, $container_pipeline = undef, $allow_versions = false, - $mount_check = false, + $mount_check = undef, $account_pipeline = undef, $log_facility = 'LOG_LOCAL2', $log_level = 'INFO', @@ -75,6 +75,14 @@ class swift::storage::all( $log_udp_port = undef, ) { + if (!$mount_check) { + warning('The default for the mount_check parameter will change from false to true in the next release to match upstream. To disable this warning, set mount_check=false.') + $mount_check_real = false + } + else { + $mount_check_real = $mount_check + } + class { '::swift::storage': storage_local_net_ip => $storage_local_net_ip, } @@ -82,7 +90,7 @@ class swift::storage::all( Swift::Storage::Server { devices => $devices, storage_local_net_ip => $storage_local_net_ip, - mount_check => $mount_check, + mount_check => $mount_check_real, log_level => $log_level, log_udp_host => $log_udp_host, log_udp_port => $log_udp_port, diff --git a/manifests/storage/server.pp b/manifests/storage/server.pp index 5b3a0b71..f7e2da16 100644 --- a/manifests/storage/server.pp +++ b/manifests/storage/server.pp @@ -47,8 +47,8 @@ # # [*mount_check*] # (optional) Whether or not check if the devices are mounted to prevent accidentally -# writing to the root device -# Defaults to false. +# writing to the root device. +# Defaults to false. Soon to be changed to 'true' to match Swift defaults. # # [*user*] # (optional) User to run as @@ -116,7 +116,7 @@ define swift::storage::server( $outgoing_chmod = '0644', $max_connections = 25, $pipeline = ["${type}-server"], - $mount_check = false, + $mount_check = undef, $user = 'swift', $workers = '1', $allow_versions = false, @@ -141,6 +141,14 @@ define swift::storage::server( warning('The default outgoing_chmod set to 0644 may yield in error prone directories and will be changed in a later release.') } + if (!$mount_check) { + warning('The default for the mount_check parameter will change from false to true in the next release to match upstream. To disable this warning, set mount_check=false.') + $mount_check_real = false + } + else { + $mount_check_real = $mount_check + } + # Warn if ${type-server} isn't included in the pipeline if is_array($pipeline) { if !member($pipeline, "${type}-server") { diff --git a/templates/account-server.conf.erb b/templates/account-server.conf.erb index f040fec8..4628309e 100644 --- a/templates/account-server.conf.erb +++ b/templates/account-server.conf.erb @@ -2,7 +2,7 @@ devices = <%= @devices %> bind_ip = <%= @storage_local_net_ip %> bind_port = <%= @bind_port %> -mount_check = <%= @mount_check %> +mount_check = <%= @mount_check_real %> user = <%= @user %> workers = <%= @workers %> log_name = <%= @log_name %> diff --git a/templates/container-server.conf.erb b/templates/container-server.conf.erb index eee15a30..6eef2aaf 100644 --- a/templates/container-server.conf.erb +++ b/templates/container-server.conf.erb @@ -2,7 +2,7 @@ devices = <%= @devices %> bind_ip = <%= @storage_local_net_ip %> bind_port = <%= @bind_port %> -mount_check = <%= @mount_check %> +mount_check = <%= @mount_check_real %> user = <%= @user %> log_name = <%= @log_name %> log_facility = <%= @log_facility %> diff --git a/templates/object-server.conf.erb b/templates/object-server.conf.erb index 0ebe68c8..dfc35845 100644 --- a/templates/object-server.conf.erb +++ b/templates/object-server.conf.erb @@ -2,7 +2,7 @@ devices = <%= @devices %> bind_ip = <%= @storage_local_net_ip %> bind_port = <%= @bind_port %> -mount_check = <%= @mount_check %> +mount_check = <%= @mount_check_real %> user = <%= @user %> log_name = <%= @log_name %> log_facility = <%= @log_facility %>