Skip to content

Configure vagrant+ansible #325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
target/

.vagrant/

# these files autogenerated by mvn eclipse:eclipse
.classpath
.project
Expand All @@ -12,3 +14,5 @@ mystamps.iml
# jasmine-maven-plugin uses phantomjs-maven-plugin.
# phantomjs-maven-plugin creates this log file.
phantomjsdriver.log

# vagrant generated files
31 changes: 31 additions & 0 deletions vagrant/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|

config.vm.box = "ubuntu/trusty64"


config.vm.provider "virtualbox" do |vb|
# Customize the amount of memory on the VM:
vb.memory = ENV["MYSTAMP_MEMORY"] || "2048"
vb.name = "mystamps-devel"
end

config.vm.synced_folder ENV["MYSTAMPS_PATH"] || "../.", "/data/src/"
config.vm.network "private_network", ip: '10.245.2.25'
config.vm.network "forwarded_port", guest: 8080, host: 8080

# before ansible provisioning, make sure we have ansible installed on the guest.
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get install -y ansible
SHELL

config.vm.provision :ansible do |ansible|
ansible.limit = "mystamps-devel"
ansible.verbose = ENV["ANSIBLE_VERBOSE"] || "vvvvv"
ansible.playbook = "mystamps-base.yml"
ansible.inventory_path = "inventory"
end

end
1 change: 1 addition & 0 deletions vagrant/inventory
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mystamps-devel ansible_ssh_host=10.245.2.25
9 changes: 9 additions & 0 deletions vagrant/mystamps-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- hosts: mystamps-devel
user: vagrant
sudo: true

vars_files:
- vars/all

roles:
- role: common
6 changes: 6 additions & 0 deletions vagrant/roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Change the default hostname
hostname: name=mystamps-devel

- name: Update cache
apt: update_cache=yes upgrade=dist
Empty file added vagrant/vars/all
Empty file.