Closed mattlqx closed 6 years ago
Beat me by 5 minutes.... cookbook worked before vacation, came back and broken. For now, including this in my kitchen.yml solves the problem (at least for local testing).
require_chef_omnibus: 12.19.36
Yes, this is why you should always pin your versions.
knife bootstrap --bootstrap-version 12.19.96
There is issue #20 to add support for chef 13 which hasn't been implemented yet. Pull requests welcome.
The purpose of the :change is to work around an issue where the windows scheduled task would be created at a time in the future.
I've opened an issue with chef https://github.com/chef/chef/issues/6059
This will be fixed in this cookbook, but since we won't be moving to chef 13 for atleast a few more months I can't give an exact time frame for how quickly it will be fixed here.
:change
action has been removed as it was redundant. Please refer https://github.com/chef/chef/issues/6059#issuecomment-293842575
Starting testing on this.
Removing the :change action breaks chef 12 Pushed 4.12.1 as temporary work around until I figure out how to support both chef 12 and chef 13. Trying to avoid binding chef versions to cookbook versions since it will prevent users from having mixed environments.
How about just determining the action based on Chef version?
node['chef_packages']['chef']['version'].split('.').first.to_i <= 12 ? :change : :create
I think querying the running version of chef would be theoretically more reliable that querying the installed version of chef. (since it is possible with the omnibus cookbook to change that mid chef run).
Currently testing something like this
action :change if Chef::VERSION.split('.')[0] = 12
or
action :change if Gem::Requirement.create('>= 13').satisfied_by?(Gem::Version.create(Chef::VERSION))
This isn't a simple one line change like I would have hoped. This will require a rewrite of the scheduled tasks and a release of cookbook 5.0.0.
Chef 13.4.19 appears to have fixed the windows tasks. Hoping to have this fixed in the 5.0.0 release of ad-join
Fixed in #29
Chef 13 now has a built-in
windows_task
resource that gets preferred over thewindows
cookbook's resource. The new resource no longer has a:change
action so a join will fail under Chef 13.