Set the "changed" value when using the raw module

Hi all,

I am using the following task in a playbook:

  • name: Install .Net 4.6.2
    raw: c:/temp/NDP462-KB3151800-x86-x64-AllOS-ENU.exe /q /norestart
    when: raw_output.stdout | version_compare(‘394806’, ‘<’)
    notify:
  • reboot

Everything works with the exception of the “notify”. I’m assuming this is because the “changed” value returned by the raw module is false. Is there a way to force “changed” to be true?

Thanks,

Justin

We changed raw in 2.2 to return changed: true for consistency with the other non-idempotent modules (shell/script/command/etc). You can override with changed_when if you’re not on 2.2 yet.

Though for what you’re doing, you should probably use win_chocolatey or win_package, as they’ll actually give you idempotency.

Thanks!

I tried win_chocolatey and it works fine on Win2008; however, on Win2012, it was trying to install patches designed for 2008 and are not applicable for 2012. I also looked into win_package; however, this module requires a product_id and on Win2012, .Net 4.6.2 doesn’t show up in “Programs and Features.” It shows up as a “KB” patch instead via “View installed updates.”