chef: windows_task does not have a :change action

In chef 13, the windows_task was ported from the windows cookbook.

The port does not include a :change action. This will cause any cookbook that attempts to modify a windows scheduled task to fail.

           * windows_task[modify sched task start time] action change
             
             ================================================================================
             Error executing action `change` on resource 'windows_task[modify sched task start time]'
             ================================================================================
             
             NoMethodError
             -------------
             undefined method `action_change' for #<Chef::Provider::WindowsTask:0x00000005285d70>
             Did you mean?  action_enable
                     action_create
             
             Resource Declaration:
             ---------------------
             # In C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/ad-join/resources/domain_join.rb
             
       72:     windows_task 'modify sched task start time' do
       73:       task_name 'chef ad-join' # http://bit.ly/1WDZ1kn
       74:       start_day '06/09/2016'
       75:       start_time '01:00'
       76:       only_if { node['kernel']['cs_info']['domain_role'].to_i == 0 || node['kernel']['cs_info']['domain_role'].to_i == 2 }
       77:       action :change
       78:     end
       79: 

See related issue https://github.com/NetDocuments/ad-join-cookbook/issues/23

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

I think what we’ll potentially want to do here is alias change to create so we don’t break legacy cookbooks. We can then introduce a foodcritic rule to move people over to the new action.