sous-chefs / cron

Development repository for the cron cookbook
https://supermarket.chef.io/cookbooks/cron
Apache License 2.0
78 stars 100 forks source link

7.0.0 don't run on chef 12.X #133

Closed theundefined closed 3 years ago

theundefined commented 3 years ago

:ghost: Brief Description

cron cookbook after upgrade to 7.0 stop working on chef 12.X

:pancakes: Cookbook version

7.0.0

:woman_cook: Chef-Infra Version

12.21.26

:tophat: Platform details

linux

Steps To Reproduce

Steps to reproduce the behavior:

install cron cookbook 7.0 on chef 12.X. Run chef-client. Exception:

Compiling Cookbooks...

================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/cron/resources/access.rb
================================================================================

NoMethodError
-------------
undefined method `unified_mode' for #<Class:0x0000000004c374a0>

Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/cron/resources/access.rb:24:in `class_from_file'

Relevant File Content:
----------------------
/var/chef/cache/cookbooks/cron/resources/access.rb:

 17:  # Unless required by applicable law or agreed to in writing, software
 18:  # distributed under the License is distributed on an "AS IS" BASIS,
 19:  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 20:  # See the License for the specific language governing permissions and
 21:  # limitations under the License.
 22:  #
 23:  
 24>> unified_mode true
 25:  
 26:  property :user, String,
 27:            name_property: true
 28:  
 29:  action :allow do
 30:    with_run_context :root do
 31:      edit_resource(:template, '/etc/cron.allow') do |new_resource|
 32:        source 'cron_manage.erb'
 33:        cookbook 'cron'

System Info:
------------
chef_version=12.21.26
platform=debian
platform_version=8.11
ruby=ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-linux]
program_name=chef-client worker: ppid=10676;start=14:42:23;
executable=/opt/chef/bin/chef-client

:police_car: Expected behavior

chef is ok

:heavy_plus_sign: Additional context

Add any other context about the problem here. e.g. related issues or existing pull requests.

mfortin commented 3 years ago

Same with Chef Client 14.7.17. The usage of unified_mode has to be done on 15+ only.

tas50 commented 3 years ago

Chef 12 has been EOL since April 2018. If you're still running that release you're going to need to get very aggressive with pinning cookbook releases or stop pulling in new community cookbooks as they're not going to be targeting that old of a release at this point. This cookbook now requires 15.3 or later, which itself is still EOL. I'd highly suggest looking at using Cookstyle or Chef Workstation's Upgrade Lab to identify the work involved in upgrading to a more modern release of Chef Infra Client.

theundefined commented 3 years ago

Ok, but in readme is still information that chef 12.7+ is supported :-) https://github.com/sous-chefs/cron#chef In https://supermarket.chef.io/cookbooks/cron there is info about supporting (>= 12.15) versions.

Until 7.0 release cookbook works fine :-) (for me)