---
- name: Install asdf plugins
  command: "asdf plugin-add {{ item }}"
  args:
    creates: "~/.asdf/plugins/{{ item }}"
  tags: [asdf]
  environment:
    PATH: "{{ ansible_env.PATH }}:/home/vagrant/.asdf/bin"
  with_items:
    - elixir
    - erlang
    - nodejs
    - elm
    - terraform
    - terragrunt

- name: Fix asdf-nodejs installation
  command: bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
  tags: [asdf]

- name: Install python versions
  shell: pyenv install {{ item }} -s
  args:
    creates: ~/.pyenv/versions/{{ item }}
  with_items: "{{ pyenv_versions }}"
  tags: [python, install]
  ignore_errors: yes

---
- name: Install asdf plugins
  command: "asdf plugin-add {{ item }}"
  args:
    creates: "~/.asdf/plugins/{{ item }}"
  tags: [asdf]
  environment:
    PATH: "{{ ansible_env.PATH }}:/home/vagrant/.asdf/bin"
  with_items:
    - elixir
    - erlang
    - nodejs
    - terraform

- name: Install latest version of everything managed by asdf
  shell: "asdf plugin-list | xargs -I _ asdf install _ latest "
  tags: [asdf]
  environment:
    PATH: "{{ ansible_env.PATH }}:/home/vagrant/.asdf/bin"

- name: Fix asdf-nodejs installation
  command: bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
  tags: [asdf]

- name: Install python versions
  shell: pyenv install {{ item }} -s
  args:
    creates: ~/.pyenv/versions/{{ item }}
  with_items: "{{ pyenv_versions }}"
  tags: [python, install]
  ignore_errors: yes

Install latest version of all asdf plugins
Install latest version of all asdf plugins
