sous-chefs / users

Development repository for the users cookbook
https://supermarket.chef.io/cookbooks/users
Apache License 2.0
138 stars 218 forks source link

Cookbook broke on chef 13 #400

Closed lucasslima closed 7 years ago

lucasslima commented 7 years ago

Cookbook version

4.0.4

Chef-client version

13.0.113

Scenario:

Any chef-client run

Steps to Reproduce:

Just run chef-client with chef 13.03

Expected Result:

Working recipe

Actual Result:

Chef-client error

================================================================================ Recipe Compile Error in /tmp/kitchen/cache/cookbooks/stilingue_deploy/recipes/retroactive.rb

     NoMethodError
     -------------
     undefined method `supports' for Chef::Resource::User::LinuxUser

     Cookbook Trace:
     ---------------
       /tmp/kitchen/cache/cookbooks/zabbix-agent/recipes/install.rb:25:in `block in from_file'
       /tmp/kitchen/cache/cookbooks/zabbix-agent/recipes/install.rb:20:in `from_file'
       /tmp/kitchen/cache/cookbooks/zabbix-agent/recipes/configure.rb:9:in `from_file'
       /tmp/kitchen/cache/cookbooks/zabbix-agent/recipes/service.rb:9:in `from_file'
       /tmp/kitchen/cache/cookbooks/zabbix-agent/recipes/default.rb:9:in `from_file'
       /tmp/kitchen/cache/cookbooks/stilingue_backend_base/recipes/zabbix.rb:7:in `from_file'
       /tmp/kitchen/cache/cookbooks/stilingue_backend_base/recipes/default.rb:13:in `from_file'
       /tmp/kitchen/cache/cookbooks/stilingue_deploy/recipes/default.rb:16:in `from_file'
       /tmp/kitchen/cache/cookbooks/stilingue_deploy/recipes/retroactive.rb:15:in `from_file'

     Relevant File Content:
     ----------------------
     /tmp/kitchen/cache/cookbooks/zabbix-agent/recipes/install.rb:

      18:      system true
      19:    end
      20:    user node['zabbix']['agent']['user'] do
      21:      shell node['zabbix']['agent']['shell']
      22:      uid node['zabbix']['agent']['uid'] if node['zabbix']['agent']['uid']
      23:      gid node['zabbix']['agent']['gid'] || node['zabbix']['agent']['group']
      24:      system true
      25>>     supports manage_home: true
      26:    end
      27:  end
      28:  
      29:  directory node['zabbix']['install_dir'] do
      30:    owner node['zabbix']['agent']['user']
      31:    group node['zabbix']['agent']['group']
      32:    mode '755'
      33:  end
      34:  

     System Info:
     ------------
     chef_version=13.0.113
     platform=ubuntu
     platform_version=14.04
     ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
     program_name=chef-client worker: ppid=1781;start=22:11:14;
     executable=/opt/chef/bin/chef-client
iennae commented 7 years ago

This doesn't look like an issue with the users cookbook.

/tmp/kitchen/cache/cookbooks/zabbix-agent/recipes/install.rb: 18: system true 19: end 20: user node['zabbix']['agent']['user'] do 21: shell node['zabbix']['agent']['shell'] 22: uid node['zabbix']['agent']['uid'] if node['zabbix']['agent']['uid'] 23: gid node['zabbix']['agent']['gid'] || node['zabbix']['agent']['group'] 24: system true 25>> supports manage_home: true 26: end

Based on the error message you have, you need to remove the supports from the resource defined in your zabbix-agent cookbook. Supports was deprecated with 12.14 and has been removed as of Chef 13.

lucasslima commented 7 years ago

I'm terribly sorry, tiredness at the end of the day got the better of me. Thanks for the advice tough!