Skip to content

Instantly share code, notes, and snippets.

@markgraf
Created July 29, 2020 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markgraf/8d5be7d32cb6dcaa86d3fa63c74a2f69 to your computer and use it in GitHub Desktop.
Save markgraf/8d5be7d32cb6dcaa86d3fa63c74a2f69 to your computer and use it in GitHub Desktop.

Unfortunately there is no repo for vagrant-packages to install .deb-packages from (see an ages old issue), so here's an ugly hack to install the latest version of vagrant through Ansible.

- name: Find latest vagrant-version
  shell: wget -qO - https://releases.hashicorp.com/vagrant/ | grep -o 'vagrant_[[:digit:]]\.[[:digit:]]\.[[:digit:]]' | sed 's/vagrant_//'| head -1
  register: vagrant_version.

- name: Install vagrant
  apt:
    deb: "https://releases.hashicorp.com/vagrant/{{ vagrant_version }}/vagrant_{{ vagrant_version }}_x86_64.deb"
  when: ansible_os_family | lower == 'debian'
  become: yes

An alternative would be to use ubuntu-ppa on Debian. Hm. Not so sure about that.

Hopefully they'll integrate vagrant into their freshly announced linux-repos some time soon...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment