From fb2fcc6084dfeff1305b2ea25105ee927e666815 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 12 Aug 2015 19:36:38 +0200 Subject: [PATCH] library/roles: Basic role to install vagrant from the vagrant site. --- vagrant/defaults/main.yml | 10 ++++++++++ vagrant/tasks/main.yml | 15 +++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 vagrant/defaults/main.yml create mode 100644 vagrant/tasks/main.yml diff --git a/vagrant/defaults/main.yml b/vagrant/defaults/main.yml new file mode 100644 index 00000000..630b0cbb --- /dev/null +++ b/vagrant/defaults/main.yml @@ -0,0 +1,10 @@ +--- +vagrant_install: False +vagrant_package_from_site: False +vagrant_site_version: 1.7.4 +vagrant_url: 'https://dl.bintray.com/mitchellh/vagrant/vagrant_{{ vagrant_site_version }}_x86_64.deb' + +vagrant_package_list: + - 'linux-headers-{{ ansible_kernel }}' + - vagrant + - virtualbox diff --git a/vagrant/tasks/main.yml b/vagrant/tasks/main.yml new file mode 100644 index 00000000..82e6624d --- /dev/null +++ b/vagrant/tasks/main.yml @@ -0,0 +1,15 @@ +--- +- name: Install the vagrant packages and requirements + apt: name={{ item }} state={{ pkg_state }} + with_items: vagrant_package_list + tags: vagrant + +- name: Get the package from the vagrant site + get_url: url='{{ vagrant_url }}' dest=/opt/vagrant_{{ vagrant_site_version }}_x86_64.deb + when: vagrant_package_from_site + tags: vagrant + +- name: Install the package from the vagrant site + apt: deb=/opt/vagrant_{{ vagrant_site_version }}_x86_64.deb + when: vagrant_package_from_site + tags: vagrant