---
- name: Install Heroku Toolbelt
  homebrew_cask: name=heroku-toolbelt state=installed

- name: Update Toolbelt
  shell: heroku update
  changed_when: no
  tags: update

- name: Create ~/.bin
  file: dest=~/.bin state=directory

- name: Link executables
  file: src={{ item }} dest=~/.bin/{{ item | basename }} state=link
  with_fileglob:
    - ./*

- name: Install plugins
  git: >
    repo=git://github.com/{{ item }}.git
    dest=~/.heroku/plugins/{{ item | basename }}
  with_items:
    - ddollar/heroku-config
    - heroku/heroku-oauth
    - heroku/heroku-pg-extras
    - heroku/heroku-repo
    - heroku/heroku-two-factor
    - tpope/heroku-binstubs
    - tpope/heroku-pgbackups-pull
    - tpope/heroku-remote
    - tpope/heroku-surrogate
    - tpope/heroku-wildcards
  tags: update

---
- name: Install Heroku Toolbelt
  homebrew_cask: name=heroku-toolbelt state=installed

- name: Update Toolbelt
  shell: heroku update
  changed_when: no
  tags: update

- name: Create ~/.bin
  file: dest=~/.bin state=directory

- name: Link executables
  file: src={{ item }} dest=~/.bin/{{ item | basename }} state=link
  with_fileglob:
    - ./*

- name: Install plugins
  git: >
    repo=git://github.com/{{ item }}.git
    dest=~/.heroku/plugins/{{ item | basename }}
  with_items:
    - ddollar/heroku-config
    - heroku/heroku-oauth
    - heroku/heroku-pg-extras
    - heroku/heroku-repo
    - tpope/heroku-binstubs
    - tpope/heroku-pgbackups-pull
    - tpope/heroku-remote
    - tpope/heroku-surrogate
    - tpope/heroku-wildcards
  tags: update

Remove deprecated Heroku two factor plugin
Remove deprecated Heroku two factor plugin
