41 lines
1.0 KiB
YAML
41 lines
1.0 KiB
YAML
---
|
|
- name: vagrant | Install system dependencies
|
|
apk:
|
|
name: libvirt-dev, ruby-bundler
|
|
state: present
|
|
tags: system
|
|
become: yes
|
|
|
|
- name: vagrant | Clone vagant repository
|
|
git:
|
|
depth: 1
|
|
repo: https://github.com/hashicorp/vagrant.git
|
|
dest: '{{ vagrant_dir }}'
|
|
|
|
- name: vagrant | Build vagrant
|
|
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'
|
|
register: vagrant_plugin_check
|
|
changed_when: no
|
|
failed_when: no
|
|
|
|
- name: vagrant | Install vagrant-libvirt plugin
|
|
command:
|
|
cmd: ~/.local/bin/vagrant plugin install vagrant-libvirt
|
|
when: vagrant_plugin_check.rc == 1
|
|
environment:
|
|
CONFIGURE_ARGS: with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib
|