Uninstall software using win_package, with uninstall.exe file and without product_id

26 views
Skip to first unread message

Cindy

unread,
Jun 19, 2019, 5:29:54 AM6/19/19
to Ansible Project
Good day to All.

Hoping someone can help me solve my uninstall issue in my playbook.

Sample Playbook:

- name: Uninstall existing Collabnet Auto Update
  win_package:
    path: "C:\Program Files\CollabNet\Subversion Client\uninst.exe
    product_id: auto
    arguments:
      - /S
    state: absent
    validate_certs: no
  register: uninstall_collab_status

- name: Uninstall GIT
  win_package:
    path: C:\Program Files\Git\unins000.exe
    product_id: auto
    arguments:
      - /SILENT
    state: absent
  register: uninstall_git_status

Result:
TASK [Uninstall Collabnet] *********************************
ok: [Host IP]

TASK [Uninstall GIT] ****************************************
ok: [Host IP]

Changed: False
When I checked the Host, Both software still exists.

Steps did in debugging:

1. Tried to use Powershell commands to check Product ID of both softwares using
     Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -like 'Git *'}
     Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -like 'CollabNet *'}

    But it doesn't return any.

2. Tried to use cmd in host, to check if silent uninstall works
    uninst.exe /S
    unins000.exe /SILENT

    These commands work.

Question:
Can someone help me how uninstall these softwares using ansible?
Reply all
Reply to author
Forward
0 new messages