initial import

This commit is contained in:
Tobias Wallura 2016-02-03 00:03:11 +01:00
commit 06ec94a862
11 changed files with 107 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.kitchen
Gemfile.lock

27
.kitchen.yml Normal file
View File

@ -0,0 +1,27 @@
driver:
name: docker
platforms:
- name: centos-7
driver_config:
image: corux/centos7-salt
- name: debian-8
- name: fedora-latest
provisioner:
name: salt_solo
formula: vagrant
pillars-from-files:
vagrant.sls: pillar.example
pillars:
top.sls:
base:
"*":
- vagrant
state_top:
base:
"*":
- vagrant
suites:
- name: default

6
.travis.yml Normal file
View File

@ -0,0 +1,6 @@
sudo: required
services:
- docker
script:
- kitchen test

7
FORMULA Normal file
View File

@ -0,0 +1,7 @@
name: vagrant
os: CentOS, Fedora, Debian
os_family: RedHat, Debian
version: 201602
release: 1
summary: Formula for installing Vagrant
description: Formula for installing Vagrant

5
Gemfile Normal file
View File

@ -0,0 +1,5 @@
source "https://rubygems.org"
gem "test-kitchen"
gem "kitchen-docker"
gem "kitchen-salt"

19
README.rst Normal file
View File

@ -0,0 +1,19 @@
===============
vagrant-formula
===============
.. image:: https://travis-ci.org/corux/vagrant-formula.svg?branch=master
:target: https://travis-ci.org/corux/vagrant-formula
Installs Vagrant.
Available states
================
.. contents::
:local:
``vagrant``
-----------
Installs Vagrant.

3
pillar.example Normal file
View File

@ -0,0 +1,3 @@
vagrant:
plugins:
- vagrant-aws

View File

@ -0,0 +1,11 @@
require 'serverspec'
set :backend, :exec
describe command("which vagrant") do
its(:exit_status) { should eq 0 }
end
describe command("vagrant plugin list | grep vagrant-aws") do
its(:exit_status) { should eq 0 }
end

2
vagrant/defaults.yaml Normal file
View File

@ -0,0 +1,2 @@
vagrant:
version: 1.8.1

13
vagrant/init.sls Normal file
View File

@ -0,0 +1,13 @@
{% from "vagrant/map.jinja" import vagrant with context %}
vagrant:
pkg.installed:
- sources:
- vagrant: {{ vagrant.url }}
{% for plugin in vagrant.get('plugins', []) %}
vagrant-plugin-{{ plugin }}:
cmd.run:
- name: "vagrant plugin install '{{ plugin }}'"
- unless: "vagrant plugin list | grep '{{ plugin }}'"
{% endfor %}

12
vagrant/map.jinja Normal file
View File

@ -0,0 +1,12 @@
{% import_yaml 'vagrant/defaults.yaml' as default_settings %}
{% set vagrant = salt['pillar.get']('vagrant', default=default_settings.get('vagrant'), merge=True) %}
{% set baseurl = 'https://releases.hashicorp.com/vagrant/' ~ vagrant.version ~ '/vagrant_' ~ vagrant.version ~ '_x86_64' %}
{% set vagrant = salt['grains.filter_by']({
'RedHat': {
'url': baseurl ~ '.rpm'
},
'Debian': {
'url': baseurl ~ '.deb'
}
}, grain = 'os_family', merge=vagrant) %}