OK-5122 Add uninstall_android_sdk.yml playbook and update readme#60
Conversation
| cmd: "rmdir /opt/orka/bin 2>/dev/null || true" | ||
| changed_when: false | ||
|
|
||
| - name: Uninstall socat |
There was a problem hiding this comment.
Should we uninstall socat? It's installed via brew, and could already be installed on the host (it is a popular tool)
This would be an unintended side effect of running the playbook if it was already installed on the machine
| path: /Library/Java/JavaVirtualMachines/temurin-21.jre | ||
| state: absent | ||
|
|
||
| # ── Reverse of install_homebrew ── |
There was a problem hiding this comment.
Should this be removed? It is commented out
There was a problem hiding this comment.
If we want to offer this ability to remove Homebrew - I would instead
- Move this logic to a role (it could even be moved to the install_homebrew role)
- Have a var to remove Homebrew that defaults to
false. Users can set the var totruewhen running the playbook if they want to remove Homebrew
|
I restructured things into Set Also updated the |
|
|
||
| - name: Remove orka bin directory (if empty) | ||
| become: true | ||
| ansible.builtin.shell: |
There was a problem hiding this comment.
nit - I would simply omit this step. The shell command is a bit awkward here, and there's no harm really in the directory being leftover
| path: "/Users/{{ ansible_user }}/.zshrc" | ||
| marker: "# {mark} ANDROID SDK" | ||
| state: absent | ||
| when: uninstall_android_sdk_zshrc_block | bool |
There was a problem hiding this comment.
nit - don't think we need a separate var for this. If we remove the directory, then we can remove it from the users PATH env var as well
(we already do something similar for the homebrew uninstall logic below :))
Summary
Adds
uninstall_android_sdk.yml, a new playbook that reversesinstall_android_sdk.yml. Useful for resetting hosts between test runs, manually decommissioning Android tooling on a node, and as part of CI cleanup workflows.Why
install_android_sdk.ymllays down a non-trivial amount of state on the host (Java JDK, Android SDK, Homebrew, socat, run-avd, and.zshrcenv vars). Until now there was no playbook-driven way to remove it, leaving operators to either:uninstall_android_sdk.ymlmakes the install/uninstall pair symmetric and removable.What it removes
run-avdscript at/opt/orka/bin/run-avd/opt/orka/logs/avd/socat(via Homebrew)JAVA_HOME/ANDROID_HOME/PATHblock from the user's.zshrc/opt/android-sdkHomebrew itself is left in place since it may be used by other tooling on the host. The playbook includes commented-out tasks at the bottom to remove Homebrew if desired.
README updates included
Test plan
install_android_sdk.ymlon a clean host — confirm everything listed above is created/installeduninstall_android_sdk.ymlon the same host — confirm everything listed above is removed (Homebrew remains)install_android_sdk.ymlagain on the now-cleaned host — confirm clean reinstall succeeds (idempotency check)