Files
ansible/oldstuff/tasks/uninstall-axinstall.yaml
2024-09-12 09:27:25 +00:00

24 lines
837 B
YAML

---
- name: Uninstall AXInstall
ansible.windows.win_powershell:
script: |
$lastInstall = (Get-ItemProperty -Path HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\AXInstall\ -Name LastInstall).LastInstall
$uninstallString = (Get-ItemProperty -Path HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$lastInstall\ -Name UninstallString).UninstallString
iex "cmd /c '$uninstallString' /S /ForceReboot=False"
Start-Sleep -Seconds 30
Get-Process Au_ | Wait-Process
- name: Reboot
win_reboot:
- name: Cleanup IFSAXSystem folder
win_file:
path: D:\IFSAXSystem
state: absent
- name: Send notification message via Slack
delegate_to: localhost
community.general.slack:
token: "{{ slack_token }}"
msg: uninstall Done on {{ inventory_hostname }}