From 3a4474c0c969853f18cad077580b1b4aee2d86e9 Mon Sep 17 00:00:00 2001 From: Grant Ridder Date: Tue, 25 Oct 2016 13:13:13 -0700 Subject: [PATCH 1/4] Swtich from node.set to default/override `node.set` is deprecated --- recipes/configure.rb | 2 +- test/unit/spec/sentinel_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/configure.rb b/recipes/configure.rb index 0356eac3..fb138952 100644 --- a/recipes/configure.rb +++ b/recipes/configure.rb @@ -81,4 +81,4 @@ end end -node.set['redisio']['servers'] = redis_instances +node.default['redisio']['servers'] = redis_instances diff --git a/test/unit/spec/sentinel_spec.rb b/test/unit/spec/sentinel_spec.rb index 21d137b6..5d8af6ae 100644 --- a/test/unit/spec/sentinel_spec.rb +++ b/test/unit/spec/sentinel_spec.rb @@ -34,7 +34,7 @@ it 'creates a specified sentinel instance' do chef_run = ChefSpec::SoloRunner.new do |node| - node.set['redisio']['sentinels'] = [ + node.override['redisio']['sentinels'] = [ { 'sentinel_port' => '1234', 'name' => 'sentinel-test-params', @@ -57,7 +57,7 @@ it 'should not create a sentinel instance' do chef_run = ChefSpec::SoloRunner.new do |node| - node.set['redisio']['sentinels'] = [] + node.override['redisio']['sentinels'] = [] end.converge(*recipes) # *splat operator for array to vararg expect(chef_run).to run_redisio_sentinel('redis-sentinels').with( sentinels: [] From 76586b61bf6616d60041eaa661626d3f25ff65b1 Mon Sep 17 00:00:00 2001 From: Grant Ridder Date: Tue, 25 Oct 2016 13:22:23 -0700 Subject: [PATCH 2/4] Clean up CHEF-3694 warnings `WARN: Cloning resource attributes for execute[reload-systemd] from prior resource (CHEF-3694)` --- recipes/enable.rb | 4 ++-- recipes/sentinel_enable.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/enable.rb b/recipes/enable.rb index 4b37b95d..f6849592 100644 --- a/recipes/enable.rb +++ b/recipes/enable.rb @@ -20,7 +20,7 @@ redis = node['redisio'] -execute 'reload-systemd' do +execute 'reload-systemd-enable' do command '/usr/bin/systemctl daemon-reload' only_if { node['redisio']['job_control'] == 'systemd' } action :nothing @@ -41,7 +41,7 @@ else link "/etc/systemd/system/multi-user.target.wants/redis@#{server_name}.service" do to '/usr/lib/systemd/system/redis@.service' - notifies :run, 'execute[reload-systemd]', :immediately + notifies :run, 'execute[reload-systemd-enable]', :immediately end end end diff --git a/recipes/sentinel_enable.rb b/recipes/sentinel_enable.rb index aa2e2a05..0d418c2c 100644 --- a/recipes/sentinel_enable.rb +++ b/recipes/sentinel_enable.rb @@ -31,7 +31,7 @@ ] end -execute 'reload-systemd' do +execute 'reload-systemd-sentinel' do command '/usr/bin/systemctl daemon-reload' only_if { node['redisio']['job_control'] == 'systemd' } action :nothing @@ -52,7 +52,7 @@ else link "/etc/systemd/system/multi-user.target.wants/redis-sentinel@#{sentinel_name}.service" do to '/usr/lib/systemd/system/redis-sentinel@.service' - notifies :run, 'execute[reload-systemd]', :immediately + notifies :run, 'execute[reload-systemd-sentinel]', :immediately end end end From b6d1bddf0d0edfecf95070b02819a1a8a6471302 Mon Sep 17 00:00:00 2001 From: Grant Ridder Date: Mon, 12 Dec 2016 23:29:36 -0800 Subject: [PATCH 3/4] Clean up user creation warnings ``` supports { manage_home: true } on the user resource is deprecated and will be removed in Chef 13, set manage_home: true instead at 2 locations: - /var/chef/cache/cookbooks/redisio/providers/configure.rb:100:in `block (3 levels) in configure' - /var/chef/cache/cookbooks/redisio/providers/sentinel.rb:45:in `block (3 levels) in configure' ``` --- providers/configure.rb | 2 +- providers/sentinel.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/providers/configure.rb b/providers/configure.rb index ab418ea0..428d505c 100644 --- a/providers/configure.rb +++ b/providers/configure.rb @@ -103,7 +103,7 @@ def configure # Create the owner of the redis data directory user current['user'] do comment 'Redis service account' - supports manage_home: true + manage_home true home current['homedir'] shell current['shell'] system current['systemuser'] diff --git a/providers/sentinel.rb b/providers/sentinel.rb index 7d9d1947..f001c271 100644 --- a/providers/sentinel.rb +++ b/providers/sentinel.rb @@ -42,7 +42,7 @@ def configure # Create the owner of the redis data directory user current['user'] do comment 'Redis service account' - supports manage_home: true + manage_home true home current['homedir'] shell current['shell'] system current['systemuser'] From 6f6a2d576a8c19cec3cf21bd485bb294f3da57d9 Mon Sep 17 00:00:00 2001 From: Grant Ridder Date: Thu, 2 Feb 2017 10:23:35 -0800 Subject: [PATCH 4/4] Use normal instead of default for set to keep from breaking inheritence levels --- recipes/configure.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/configure.rb b/recipes/configure.rb index fb138952..1c604b35 100644 --- a/recipes/configure.rb +++ b/recipes/configure.rb @@ -81,4 +81,4 @@ end end -node.default['redisio']['servers'] = redis_instances +node.normal['redisio']['servers'] = redis_instances