Skip to content

Commit f880ae5

Browse files
committed
Merge branch 'gh268_vagrant_and_ansible'
Fix #268
2 parents e2fb2fe + 7dabaf7 commit f880ae5

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ phantomjsdriver.log
1717
src/main/webapp/WEB-INF/static/styles/*.min.css
1818
src/main/javascript/*.min.js
1919
src/main/javascript/*/*.min.js
20+
21+
# Vagrant related files
22+
.vagrant/

vagrant/Vagrantfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# To be able to set hostname on Ubuntu 16.04. we need to have vagrant at least
5+
# of version 1.8.3 See also: https://github.com/mitchellh/vagrant/issues/7288
6+
Vagrant.require_version ">= 1.8.3"
7+
8+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
9+
# configures the configuration version (we support older styles for
10+
# backwards compatibility). Please don't change it unless you know what
11+
# you're doing.
12+
Vagrant.configure(2) do |config|
13+
# The most common configuration options are documented and commented below.
14+
# For a complete reference, please see the online documentation at
15+
# https://docs.vagrantup.com.
16+
17+
# Every Vagrant development environment requires a box. You can search for
18+
# boxes at https://atlas.hashicorp.com/search.
19+
config.vm.box = "ubuntu/xenial64"
20+
21+
# Set VM hostname
22+
config.vm.hostname = "my-stamps.local"
23+
24+
# Disable automatic box update checking. If you disable this, then
25+
# boxes will only be checked for updates when the user runs
26+
# `vagrant box outdated`. This is not recommended.
27+
# config.vm.box_check_update = false
28+
29+
# Create a forwarded port mapping which allows access to a specific port
30+
# within the machine from a port on the host machine. In the example below,
31+
# accessing "localhost:8080" will access port 80 on the guest machine.
32+
# config.vm.network "forwarded_port", guest: 80, host: 8080
33+
34+
# Provider-specific configuration so you can fine-tune various
35+
# backing providers for Vagrant. These expose provider-specific options.
36+
# Example for VirtualBox:
37+
#
38+
config.vm.provider "virtualbox" do |vb|
39+
# Display the VirtualBox GUI when booting the machine
40+
#vb.gui = true
41+
42+
# Customize the amount of memory on the VM:
43+
vb.memory = "512"
44+
45+
# Set the name that appears in the VirtualBox GUI
46+
vb.name = "my-stamps"
47+
end
48+
49+
# Enable provisioning with Ansible from the Vagrant host.
50+
# See documentation for more details:
51+
# https://www.vagrantup.com/docs/provisioning/ansible_intro.html
52+
# https://www.vagrantup.com/docs/provisioning/ansible.html
53+
# https://www.vagrantup.com/docs/provisioning/ansible_common.html
54+
config.vm.provision "ansible" do |ansible|
55+
ansible.playbook = "provisioning/vagrant.yml"
56+
end
57+
58+
end

vagrant/provisioning/bootstrap.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
3+
# Ubuntu 16.04. doesn't install python 2.x anymore and we have to install
4+
# it manually to be able to run Ansible playbooks.
5+
6+
- name: Updating packages cache
7+
raw: apt-get update
8+
become: yes
9+
become_method: sudo
10+
11+
- name: Installing python
12+
raw: apt-get install -y python2.7-minimal
13+
become: yes
14+
become_method: sudo

vagrant/provisioning/vagrant.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
- hosts: all
3+
gather_facts: no
4+
vars:
5+
# required for Ubuntu 16.04. which installs Python 2.x to a non-standard path
6+
ansible_python_interpreter: "/usr/bin/python2.7"
7+
8+
pre_tasks:
9+
- name: Bootstrapping server
10+
include: bootstrap.yml
11+
12+
tasks:
13+
- name: show greeting message
14+
debug:
15+
msg: "Hello"

0 commit comments

Comments
 (0)