Can chocolatey_package resource reinstall software?


#1

I have a chocolatey package that I want to reinstall and using the chocolatey_package options ‘—force —yes’ but doesn’t seem to be working. Is reinstalling a package using this method supported in Chef?


#2

One of the core premises of Resources in Chef is to not do work if there is no work to be done, hence the package resource is probably just not firing because it sees that there is nothing to be done. You can look in your logs for an “up to date” message next to the resource. If you really wanted it to install every single time over itself (and not be idempotent) then using something like excecute might make more sense.

Cheers,


#3

Great, thanks for the suggestion!


#4

have you tried one recipe with an uninstall then install using the chocolatey_package resource?