Add vagrant VM with automatic vermont setup

master
Marcel von Maltitz 2018-02-06 11:37:36 +01:00
parent be70d52a3b
commit d171c861c8
4 changed files with 75 additions and 0 deletions

8
dev/README Normal file
View File

@ -0,0 +1,8 @@
Install Vagrant and Ansible each with version >= 2.0
Then, in this folder
$ vagrant up
...wait...
$ vagrant ssh
# cd /vermont
Here you find the vermont executable and the necessary config files under configs/

16
dev/Vagrantfile vendored Normal file
View File

@ -0,0 +1,16 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.hostname = "vermont"
config.vm.box = "trusty_amd"
config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.network "private_network", ip: "192.168.50.4"
config.vm.synced_folder "../", "/vermont"
config.vm.provision "shell", inline: "apt-get install python3" # For ansible to function
config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
ansible.extra_vars = { ansible_python_interpreter: "/usr/bin/python3" }
end
end

6
dev/playbook.yml Normal file
View File

@ -0,0 +1,6 @@
---
- hosts: all
become_user: root
become: true
roles:
- base

View File

@ -0,0 +1,45 @@
- name: Add ZMQ key
apt_key:
url: http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/xUbuntu_14.04/Release.key
state: present
- name: Add ZMQ ppa
apt_repository:
repo: deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/xUbuntu_14.04/ ./
state: present
filename: 'mq'
- name: Add toolchain
apt_repository: repo='ppa:ubuntu-toolchain-r/test'
- name: install dependencies
apt: name={{item}} state=present install_recommends=no update_cache=yes
with_items:
- cmake
- pkg-config
- libboost-dev
- libboost-filesystem-dev
- libboost-regex-dev
- libboost-test-dev
- libboost-thread-dev
- libxml2-dev
- libpcap-dev
- libsystemd-journal-dev
- libsctp-dev
- libssl-dev
- libczmq-dev
- g++-7
- name: cmake vermont
command: "{{item}}"
with_items:
- cmake -DCMAKE_INSTALL_PREFIX=/tmp -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSUPPORT_JOURNALD=ON -DSUPPORT_DTLS=ON -DSUPPORT_ZMQ=ON .
- make -k
- make test
- make install
environment:
CXX: g++-7
CC: gcc-7
args:
chdir: /vermont