38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
YAML
---
|
|
- name: Send notification message via Slack
|
|
delegate_to: localhost
|
|
community.general.slack:
|
|
token: "{{ slack_token }}"
|
|
msg: Uninstalling BOInstall on {{ inventory_hostname }}
|
|
|
|
- name: Uninstall BOInstall
|
|
ansible.windows.win_powershell:
|
|
script: |
|
|
$lastInstall = (Get-ItemProperty -Path HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\BOInstall\ -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: Send notification message via Slack
|
|
delegate_to: localhost
|
|
community.general.slack:
|
|
token: "{{ slack_token }}"
|
|
msg: Rebooting {{ inventory_hostname }}
|
|
|
|
- name: Reboot
|
|
win_reboot:
|
|
|
|
|
|
- name: Send notification message via Slack
|
|
delegate_to: localhost
|
|
community.general.slack:
|
|
token: "{{ slack_token }}"
|
|
msg: Cleanup IFSBOSystem on {{ inventory_hostname }}
|
|
|
|
- name: Cleanup IFSBOSystem folder
|
|
win_file:
|
|
path: D:\IFSBOSystem
|
|
state: absent
|