diff --git a/README.md b/README.md index c1b6a6b..916b09f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,10 @@ +### chef_stack has been deprecated. +The resources have been merged into [chef-ingredient](https://github.com/chef-cookbooks/chef-ingredient). Please update your cookbooks to use chef-ingredient. + +chef_stack will continue to be used as a testing ground to test potentially breaking changes. + +The last stable version was 0.9.0. Anything after this version, will likely break your infrastructure. + # chef_stack Chef stack is a library cookbook that provides custom resources to build and manage your Chef infrastructure. diff --git a/libraries/helpers.rb b/libraries/helpers.rb index 9696392..3dbe071 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -37,3 +37,12 @@ def ensurekv(original_config, hash) end config end + +def deprecation_notice + message = 'Chef Stack is deprecated. The resources have been merged into chef-ingredient. Please update your cookbooks to use chef-ingredient.' + log 'Deprecation' do + level :warn + message message + end + Chef.deprecated(:internal_api, message) +end diff --git a/metadata.rb b/metadata.rb index 8e93e18..2236e3e 100644 --- a/metadata.rb +++ b/metadata.rb @@ -7,6 +7,6 @@ issues_url 'https://github.com/ncerny/chef_stack/issues' if respond_to?(:issues_url) source_url 'https://github.com/ncerny/chef_stack' if respond_to?(:source_url) -version '0.8.6' +version '0.9.0' depends 'chef-ingredient' diff --git a/resources/automate.rb b/resources/automate.rb index bd21c59..72350f0 100644 --- a/resources/automate.rb +++ b/resources/automate.rb @@ -40,6 +40,8 @@ end action :create do + deprecation_notice + required_config = <<-EOF delivery['chef_username'] = '#{new_resource.chef_user}' delivery['chef_private_key'] = '/etc/delivery/#{new_resource.chef_user}.pem' diff --git a/resources/backend.rb b/resources/backend.rb index 0443cdd..5afd3ff 100644 --- a/resources/backend.rb +++ b/resources/backend.rb @@ -38,6 +38,8 @@ end action :create do + deprecation_notice + raise 'Must accept the Chef License agreement before continuing.' unless new_resource.accept_license new_resource.config = ensurekv(new_resource.config, publish_address: new_resource.publish_address) diff --git a/resources/chef_org.rb b/resources/chef_org.rb index 2d7e101..8079434 100644 --- a/resources/chef_org.rb +++ b/resources/chef_org.rb @@ -33,6 +33,8 @@ end action :create do + deprecation_notice + directory '/etc/opscode/orgs' do owner 'root' group 'root' diff --git a/resources/chef_user.rb b/resources/chef_user.rb index 382372f..36f93e9 100644 --- a/resources/chef_user.rb +++ b/resources/chef_user.rb @@ -33,6 +33,8 @@ end action :create do + deprecation_notice + directory '/etc/opscode/users' do owner 'root' group 'root' diff --git a/resources/client.rb b/resources/client.rb index 09b9963..48974ca 100644 --- a/resources/client.rb +++ b/resources/client.rb @@ -57,6 +57,8 @@ end action :install do + deprecation_notice + chef_ingredient 'chef' do action :upgrade version new_resource.version diff --git a/resources/file.rb b/resources/file.rb index 7e6bd8f..204ce0f 100644 --- a/resources/file.rb +++ b/resources/file.rb @@ -31,6 +31,8 @@ end action :create do + deprecation_notice + new_resource.source = (property_is_set?(:source) ? new_resource.source : "cookbook_file://#{new_resource.filename}") if new_resource.source.start_with?('cookbook_file://') src = new_resource.source.split('://')[1].split('::') diff --git a/resources/server.rb b/resources/server.rb index cc260c2..5c71abf 100644 --- a/resources/server.rb +++ b/resources/server.rb @@ -36,6 +36,8 @@ end action :create do + deprecation_notice + if new_resource.data_collector_url new_resource.config << "\ndata_collector['root_url'] = '#{new_resource.data_collector_url}'" new_resource.config << "\ndata_collector['token'] = '#{new_resource.data_collector_token}'" diff --git a/resources/supermarket.rb b/resources/supermarket.rb index 8bbfad3..57ab30e 100644 --- a/resources/supermarket.rb +++ b/resources/supermarket.rb @@ -37,6 +37,8 @@ end action :create do + deprecation_notice + chef_ingredient 'supermarket' do action :upgrade channel new_resource.channel diff --git a/resources/wf_builder.rb b/resources/wf_builder.rb index 20d048a..928ea7b 100644 --- a/resources/wf_builder.rb +++ b/resources/wf_builder.rb @@ -44,6 +44,8 @@ end action :create do + deprecation_notice + chef_ingredient 'chefdk' do action :upgrade channel new_resource.channel