Install
https://www.vagrantup.com/downloads.html
# sudo apt install -y jq
URL=$(wget https://checkpoint-api.hashicorp.com/v1/check/vagrant -qO- | jq -r '"https://releases.hashicorp.com/vagrant/" + .current_version + "/vagrant_" + .current_version + "_x86_64.deb"')
wget ${URL} -qP /tmp
sudo dpkg -i /tmp/${URL##*/}
vagrant --version
Install with Ansible
- name: Get latest vagrant version
uri:
url: https://checkpoint-api.hashicorp.com/v1/check/vagrant
register: release
- set_fact:
version: "{{ release.json | json_query('current_version') }}"
- name: Install Vagrant
apt:
deb: https://releases.hashicorp.com/vagrant/{{ version }}/vagrant_{{ version }}_x86_64.deb
become: yes
- name: Adding user ubuntu to group libvirt
user:
name: ubuntu
groups: libvirt
append: yes
become: yes
- name: Install vagrant-libvirt plugin
command: sudo -H -u ubuntu vagrant plugin install vagrant-libvirt
become: yes
CLI