diff --git a/Gemfile b/Gemfile index 55080da..192101d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' group :lint do - gem 'foodcritic', '~> 4.0' + gem 'foodcritic', '~> 5.0' gem 'rubocop', '~> 0.33' end diff --git a/Rakefile b/Rakefile index 4a798ce..0300fef 100644 --- a/Rakefile +++ b/Rakefile @@ -17,8 +17,7 @@ namespace :style do FoodCritic::Rake::LintTask.new(:chef) do |t| t.options = { fail_tags: ['any'], - tags: ['~FC003'], - chef_version: '11.6.0' + tags: ['~FC003'] } end rescue LoadError diff --git a/providers/client.rb b/providers/client.rb index 548b76b..2016532 100644 --- a/providers/client.rb +++ b/providers/client.rb @@ -33,7 +33,7 @@ def whyrun_supported? key = @new_resource.key || get_key(keyname) # update the key in the file - file filename do # ~FC009 + file filename do content file_content(keyname, key, as_keyring) owner owner group group @@ -111,7 +111,7 @@ def create_entity(keyname) Chef::Log.debug "Client #{keyname} created" # remove temporary keyring file - file tmp_keyring do # ~FC009 + file tmp_keyring do action :delete sensitive true if Chef::Resource::File.method_defined? :sensitive end diff --git a/recipes/mon.rb b/recipes/mon.rb index 4da92e0..715f212 100644 --- a/recipes/mon.rb +++ b/recipes/mon.rb @@ -42,14 +42,14 @@ keyring = "#{Chef::Config[:file_cache_path]}/#{cluster}-#{node['hostname']}.mon.keyring" -execute 'format mon-secret as keyring' do # ~FC009 +execute 'format mon-secret as keyring' do command lazy { "ceph-authtool '#{keyring}' --create-keyring --name=mon. --add-key='#{mon_secret}' --cap mon 'allow *'" } creates keyring only_if { mon_secret } sensitive true if Chef::Resource::Execute.method_defined? :sensitive end -execute 'generate mon-secret as keyring' do # ~FC009 +execute 'generate mon-secret as keyring' do command "ceph-authtool '#{keyring}' --create-keyring --name=mon. --gen-key --cap mon 'allow *'" creates keyring not_if { mon_secret } diff --git a/recipes/osd.rb b/recipes/osd.rb index d07f161..1af8533 100644 --- a/recipes/osd.rb +++ b/recipes/osd.rb @@ -54,7 +54,7 @@ # TODO: cluster name cluster = 'ceph' -execute 'format bootstrap-osd as keyring' do # ~FC009 +execute 'format bootstrap-osd as keyring' do command lazy { "ceph-authtool '/var/lib/ceph/bootstrap-osd/#{cluster}.keyring' --create-keyring --name=client.bootstrap-osd --add-key='#{osd_secret}'" } creates "/var/lib/ceph/bootstrap-osd/#{cluster}.keyring" only_if { osd_secret }