Skip to content

Instantly share code, notes, and snippets.

@naufraghi
Created August 8, 2014 07:23
Show Gist options
  • Save naufraghi/42f060d88ae293df1e92 to your computer and use it in GitHub Desktop.
Save naufraghi/42f060d88ae293df1e92 to your computer and use it in GitHub Desktop.
Ansible Playbook for Android SDK + gradle on c9.io
---
- hosts: local
sudo: yes
vars:
home: "{{ lookup('env','HOME') }}"
tasks:
- name: enable multiarch
command: dpkg --add-architecture i386
- name: install deps
apt: name={{ item }} update_cache=yes cache_valid_time=3600
with_items:
- gradle
- "libstdc++6:i386"
- "libgcc1:i386"
- "zlib1g:i386"
- "libncurses5:i386"
- name: cleanup old sdk
command: rm -rf {{ home }}/opt/android-sdk-linux
- name: download android sdk
get_url: url=http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz dest={{ home }}/tmp/android-sdk.tgz
- name: create {{ home }}/opt
command: /bin/mkdir -p {{ home }}/opt
- name: unpack android sdk
command: tar xvf {{ home }}/tmp/android-sdk.tgz --directory {{ home }}/opt --exclude android-sdk-linux/docs
- name: remove archive
command: rm {{ home }}/tmp/android-sdk.tgz
- name: install sdk
shell: "echo yes | {{ home }}/opt/android-sdk-linux/tools/android update sdk -u --filter android-19,platform-tools,build-tools-20.0.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment