---
- name: Add APT key for adb
  apt_key:
    keyserver: keyserver.ubuntu.com
    id: 1DB29AFFF6C70907B57AA31F531EE72F4C9D234C
  become: yes
  become_method: sudo

- name: Add APT source for adb
  apt_repository:
    repo: deb http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu precise main
  become: yes
  become_method: sudo

- name: Install APT package for adb
  apt:
    name: android-tools-adb
  become: yes
  become_method: sudo

- name: Install APT packages for heimdall
  apt:
    name: "{{ item }}"
  become: yes
  become_method: sudo
  with_items:
    - heimdall-flash
    - heimdall-flash-frontend
  when: has_heimdall

---
- name: Add APT key for adb
  apt_key:
    keyserver: keyserver.ubuntu.com
    id: 1DB29AFFF6C70907B57AA31F531EE72F4C9D234C
  become: yes
  become_method: sudo

- name: Add APT source for adb
  apt_repository:
    repo: deb http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu trusty main
  become: yes
  become_method: sudo

- name: Install APT package for adb
  apt:
    name: android-tools-adb
  become: yes
  become_method: sudo

- name: Install APT packages for heimdall
  apt:
    name: "{{ item }}"
  become: yes
  become_method: sudo
  with_items:
    - heimdall-flash
    - heimdall-flash-frontend
  when: has_heimdall

Update APT repository for adb.
Update APT repository for adb.
