From 0fa6900f62c7dd29f32957f1c8d57b9040aaae82 Mon Sep 17 00:00:00 2001 From: Seth Tunstall Date: Thu, 16 Nov 2023 20:23:38 +0000 Subject: [PATCH] easier to test for a commented-out line --- spec/classes/redis_spec.rb | 2 +- templates/redis.conf.epp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/classes/redis_spec.rb b/spec/classes/redis_spec.rb index e663ce3d..44dde6b1 100644 --- a/spec/classes/redis_spec.rb +++ b/spec/classes/redis_spec.rb @@ -1687,7 +1687,7 @@ class { 'redis': } end - it { is_expected.to contain_file(config_file_orig).with('content' => %r{^#rdb-save-incremental-fsync yes$}) } + it { is_expected.to contain_file(config_file_orig).with('content' => %r{^#rdb-save-incremental-fsync yes}) } end describe 'test rdb-save-incremental-fsync enabled' do diff --git a/templates/redis.conf.epp b/templates/redis.conf.epp index a0518834..06116102 100644 --- a/templates/redis.conf.epp +++ b/templates/redis.conf.epp @@ -1030,7 +1030,8 @@ aof-rewrite-incremental-fsync <%= bool2str($aof_rewrite_incremental_fsync, 'yes' # the file will be fsync-ed every 32 MB of data generated. This is useful # in order to commit the file to the disk more incrementally and avoid # big latency spikes. -<% if $rdb_save_incremental_fsync == undef { %>#rdb-save-incremental-fsync yes +<% if $rdb_save_incremental_fsync == undef { %> +#rdb-save-incremental-fsync yes <% } else { %> rdb-save-incremental-fsync <%= bool2str($rdb_save_incremental_fsync, 'yes', 'no') %> <% } %>