---
- name: Install jenv
  git: >
    repo=git://github.com/gcuisinier/jenv.git
    dest=~/.jenv
  tags: update

- name: Set current JVM
  shell: 'jenv global {{ dotfiles.jvm.version }}'

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

# HACK: Ansible won't link relative files?!
# https://github.com/ansible/ansible/issues/7627
- name: Link lein
  file: src={{ item }} dest=~/.bin/{{ item | basename }} state=link
  with_fileglob:
    - ./lein*

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

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

---
- name: Install jenv
  git: >
    repo=git://github.com/gcuisinier/jenv.git
    dest=~/.jenv
  tags: update

- name: Register all JVMs
  shell: 'jenv add {{ item }}/Contents/Home'
  with_fileglob:
    - /Library/Java/JavaVirtualMachines/*

- name: Set current JVM
  shell: 'jenv global {{ dotfiles.jvm.version }}'

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

# HACK: Ansible won't link relative files?!
# https://github.com/ansible/ansible/issues/7627
- name: Link lein
  file: src={{ item }} dest=~/.bin/{{ item | basename }} state=link
  with_fileglob:
    - ./lein*

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

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

Add step to register all JVMs with jenv
Add step to register all JVMs with jenv
