Disabling UAC will have no effect. Any session coming in thru WinRM is by
default elevated.
As Jon writes, some packages are simply difficult/super-hard/impossible to
uninstall in an unattended way.
On Saturday, June 11, 2016 at 9:21:21 PM UTC+2, Bob Tanner wrote:
>
> Uninstalling Windows packages via Ansible is hard. Is this normal? I
> feeling like I'm missing something fundamental using Ansible to manage
> Windows.
>
> Here's my playbook.
>
> - name: disable UAC pop up for Administrators
> win_regedit:
> key: HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System
> value: ConsentPromptBehaviorAdmin
> data: 00000000
> datatype: dword
>
> - name: remove packages (win_package)
> win_package: >
> name="Microsoft Silverlight"
> path="C:\\Program Files\\Microsoft Silverlight\\sllauncher.exe"
> product_id="{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}"
> state="absent"
>
> The task hangs and eventually timeout. Started to get desperate and added
> these plays:
>
> - name: disallow interactive services
> win_regedit:
> key: HKLM:\SYSTEM\CurrentControlSet\Control\Windows
> value: NoInteractiveServices
> data: 00000001
> datatype: dword
>
> - name: stop Interactive Services Detection
> win_service:
> name: 'UI0Detect'
> start_mode: manual
> state: stopped
>
> Still the uninstall hangs and times out.
>
> When I try uninstalling Silverlight via:
>
> msiexec /uninstall "{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}" /l
> C:\logs\zzz.log
>
> I get the "Windows Installer" dialog prompting to confirm the uninstall.
> Click "Yes" and Silverlight is uninstalled. Nothing of much value in the
> C:\logs\zzz.log file.
>
> msiexec /uninstall "{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}" /l
> C:\logs\zzz.log \quiet
>
> Uninstalls without any dialog. Nothing of much value in the logs.
>
> How do I duplicate this uninstall with win_package?
>
> I cannot seem to get win_msi to work either.
>
> I am brute forcing things with script :-(
>
> - name: remove packages (powershell script)
> script: files/remove-package.ps1
>
> remote-package.ps1
>
> $app = Get-WmiObject -Class Win32_Product -Filter "IdentifyingNumber =
> '{89F4137D-6C26-4A84-BDB8-2E5A4BB71E00}'"
> $app.Uninstall()
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/5305be3f-804f-4d0c-b0e5-92e1bce7a2b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.