---

- name: Install git
  apt: name=git state=latest

- name: Check hub installation
  stat: path=/usr/local/bin/hub
  register: hub

- name: Download hub
  get_url: url={{hub_url}} dest=/tmp
  when: hub.stat.exists == false

- name: Extract hub
  unarchive: src=/tmp/{{hub_archive}} dest=/tmp
  when: hub.stat.exists == false

- name: Install hub
  command: creates=/usr/local/bin/hub cp /tmp/{{hub_folder}}/hub /usr/local/bin/
  when: hub.stat.exists == false

---

- name: Install git
  apt: name=git state=latest

- name: Check hub installation
  stat: path=/usr/local/bin/hub
  register: hub

- name: Download hub
  get_url: url={{hub_url}} dest=/tmp
  when: hub.stat.exists == false

- name: Extract hub
  unarchive: src=/tmp/{{hub_archive}} dest=/tmp
  when: hub.stat.exists == false

- name: Install hub
  command: creates=/usr/local/bin/hub /tmp/{{hub_folder}}/install
  when: hub.stat.exists == false

Make sure to also install hub man pages
Make sure to also install hub man pages
