diff --git a/manifests/storage/all.pp b/manifests/storage/all.pp index 358e43ef..84d9e30b 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. Soon to be changed to 'true' to match Swift defaults. +# Defaults to true. # # [*account_pipeline*] # (optional) Specify the account pipeline @@ -80,7 +80,7 @@ class swift::storage::all( $object_pipeline = undef, $container_pipeline = undef, $allow_versions = false, - $mount_check = undef, + $mount_check = true, $account_pipeline = undef, $log_facility = 'LOG_LOCAL2', $log_level = 'INFO', @@ -91,14 +91,6 @@ class swift::storage::all( $outgoing_chmod = 'Du=rwx,g=rx,o=rx,Fu=rw,g=r,o=r', ) { - 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, } @@ -106,7 +98,7 @@ class swift::storage::all( Swift::Storage::Server { devices => $devices, storage_local_net_ip => $storage_local_net_ip, - mount_check => $mount_check_real, + mount_check => $mount_check, 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 38f4b95b..580f6972 100644 --- a/manifests/storage/server.pp +++ b/manifests/storage/server.pp @@ -45,7 +45,7 @@ # [*mount_check*] # (optional) Whether or not check if the devices are mounted to prevent accidentally # writing to the root device. -# Defaults to false. Soon to be changed to 'true' to match Swift defaults. +# Defaults to true. # # [*user*] # (optional) User to run as @@ -119,7 +119,7 @@ define swift::storage::server( $outgoing_chmod = 'Du=rwx,g=rx,o=rx,Fu=rw,g=r,o=r', $max_connections = 25, $pipeline = ["${type}-server"], - $mount_check = undef, + $mount_check = true, $user = 'swift', $workers = '1', $allow_versions = false, @@ -137,12 +137,12 @@ define swift::storage::server( $config_file_path = "${type}-server.conf", ) { - 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 + if ($incoming_chmod == '0644') { + warning('The default incoming_chmod set to 0644 may yield in error prone directories and will be changed in a later release.') } - else { - $mount_check_real = $mount_check + + if ($outgoing_chmod == '0644') { + warning('The default outgoing_chmod set to 0644 may yield in error prone directories and will be changed in a later release.') } # Warn if ${type-server} isn't included in the pipeline diff --git a/spec/defines/swift_storage_server_spec.rb b/spec/defines/swift_storage_server_spec.rb index 79635105..7a755797 100644 --- a/spec/defines/swift_storage_server_spec.rb +++ b/spec/defines/swift_storage_server_spec.rb @@ -171,7 +171,7 @@ describe 'swift::storage::server' do it { is_expected.to contain_file(fragment_file).with_content(/^devices\s*=\s*\/srv\/node\s*$/) } it { is_expected.to contain_file(fragment_file).with_content(/^bind_ip\s*=\s*10\.0\.0\.1\s*$/) } it { is_expected.to contain_file(fragment_file).with_content(/^bind_port\s*=\s*#{title}\s*$/) } - it { is_expected.to contain_file(fragment_file).with_content(/^mount_check\s*=\s*false\s*$/) } + it { is_expected.to contain_file(fragment_file).with_content(/^mount_check\s*=\s*true\s*$/) } it { is_expected.to contain_file(fragment_file).with_content(/^user\s*=\s*swift\s*$/) } it { is_expected.to contain_file(fragment_file).with_content(/^set log_name\s*=\s*#{t}-server\s*$/) } it { is_expected.to contain_file(fragment_file).with_content(/^set log_facility\s*=\s*LOG_LOCAL2\s*$/) } diff --git a/templates/account-server.conf.erb b/templates/account-server.conf.erb index 47c7675e..6c4ba277 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_real %> +mount_check = <%= @mount_check %> user = <%= @user %> workers = <%= @workers %> log_name = <%= @log_name %> diff --git a/templates/container-server.conf.erb b/templates/container-server.conf.erb index 6d28f8c0..fa05fd0d 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_real %> +mount_check = <%= @mount_check %> 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 212b8e33..e5d79227 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_real %> +mount_check = <%= @mount_check %> user = <%= @user %> log_name = <%= @log_name %> log_facility = <%= @log_facility %>