---

- hosts: all
  vars:
    applet_name: chrome

  tasks:
    - name: uninstall applet
      ansible.windows.win_powershell:
        script: |
          tinkerd uninstall --name {{ applet_name }}
          $exitCode = $LASTEXITCODE
          if ($exitCode -ne 0) {
              Write-Host "Failed to uninstall {{ applet_name }}"
              Write-Host "Exit code: $exitCode"
              $Ansible.Failed = $true
              exit 1
          }
