dotfiles-ansible/roles/packages/tasks/vagrant.yml

43 lines
1.1 KiB
YAML

---
- name: vagrant | Install system dependencies
community.general.apk:
name: libvirt-dev, ruby-bundler
state: present
tags: system
become: true
- name: vagrant | Clone vagant repository
git:
depth: 1
repo: https://github.com/hashicorp/vagrant.git
dest: '{{ vagrant_dir }}'
- name: vagrant | Build vagrant
community.general.bundler:
chdir: '{{ vagrant_dir }}'
state: present
gem_path: vendor
binstub_directory: exec
- name: vagrant | Symlink vagrant executable
file:
src: '{{ vagrant_dir }}/exec/vagrant'
dest: ~/.local/bin/vagrant
state: link
- name: vagrant | Check whether vagrant-libvirt plugin is installed
shell:
cmd: ~/.local/bin/vagrant plugin list | grep -qF 'vagrant-libvirt'
removes: ~/.local/bin/vagrant
register: vagrant_plugin_check
changed_when: false
failed_when: false
- name: vagrant | Install vagrant-libvirt plugin
command:
cmd: ~/.local/bin/vagrant plugin install vagrant-libvirt
removes: ~/.local/bin/vagrant
when: vagrant_plugin_check.rc == 1
environment:
CONFIGURE_ARGS: with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib