Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Vagrant for OpenStack is working nicely
  • Loading branch information
dvreed77 committed Jul 18, 2014
1 parent 4756263 commit a2787598702172717c359d359e2271954571ddf9
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 9 deletions.
@@ -7,4 +7,6 @@
*.ogg
*.mp4
*.sqlite3
*.vagrant
*.vagrant
*.cer
files/draper-openrc.sh
@@ -5,14 +5,76 @@
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "virtualbox" do |vbox|
vbox.vm.box = "centos_6.5"
vbox.vm.network "forwarded_port", guest: 80, host: 8080
vbox.vm.network "forwarded_port", guest: 8000, host: 9000

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "centos_6.5"
vbox.vm.provision :shell, path: "scripts/install.sh"
vbox.vm.provision :shell, path: "scripts/install_python.sh"
vbox.vm.provision :shell, path: "scripts/start_oe.sh"
end

config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 8000, host: 9000
config.vm.define "openstack", autostart: false do |osConfig|
require 'vagrant-openstack-plugin'

config.vm.provision :shell, path: "scripts/install.sh"
config.vm.provision :shell, path: "scripts/install_python.sh"
config.vm.provision :shell, path: "scripts/start_oe.sh"
end
osConfig.ssh.private_key_path = "/Users/dreed/draper/xdata/code/logging_server/vagrant/user-ale-logger-vagrant.cer"

osConfig.vm.box = "dummy"
osConfig.vm.box_url = "https://github.com/cloudbau/vagrant-openstack-plugin/raw/master/dummy.box"

osConfig.vm.provider :openstack do |os|
os.username = "#{ENV['OS_USERNAME']}"
os.api_key = "#{ENV['OS_PASSWORD']}"
os.flavor = /m1.small/ # Regex or String
os.image = /xdata-centos-base/ # Regex or String
os.endpoint = "#{ENV['OS_AUTH_URL']}/tokens"
os.keypair_name = "User-ALE-logger-vagrant" # as stored in Nova
os.ssh_username = "cloud-user" # login for the VM
os.floating_ip = "10.1.93.171"
os.networks = []
os.server_name = "oe_vagrant_test"
end

osConfig.ssh.pty = true

config.vm.provision :shell, path: "scripts/install.sh"
config.vm.provision :shell, path: "scripts/setup_iptables.sh"
config.vm.provision :shell, path: "scripts/install_python.sh"
config.vm.provision :shell, path: "scripts/start_oe.sh"
end

config.vm.define "aws", autostart: false do |aws| #install on ubuntu image
require 'vagrant-aws'

aws.vm.box = "dummy"
aws.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"

aws.ssh.username = "ubuntu"
aws.ssh.private_key_path = "PATH_TO_YOUR_KEY_FILE.pem"

aws.vm.provider :aws do |ec2, override|
ec2.access_key_id = "YOUR_ACCESS_KEY"
ec2.secret_access_key = "YOUR_SECRET"
ec2.keypair_name = "KEYPAIR_NAME"
ec2.instance_type = "m1.medium"
ec2.region = "us-east-1"
ec2.security_groups = ["neon-vagrant"]
ec2.tags = {
'project' => 'neon'
}
ec2.block_device_mapping = [{ :DeviceName => "/dev/sda1", 'Ebs.VolumeSize' => 20, 'Ebs.DeleteOnTermination' => true }]
ec2.ami = "ami-d805f4b0" #"ami-018c9568" #the ami for the image to install
override.ssh.pty = true
end

aws.vm.synced_folder ".", "/vagrant", disabled: true

aws.vm.synced_folder "./puppet/", "/puppet"

aws.vm.provision "shell",
inline: "echo \"Applying puppet\" && puppet apply /puppet/ubuntu.pp"

aws.vm.network "forwarded_port", host: 4567, guest: 8080
end
end
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

sudo iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp --dport 8000 -j ACCEPT -m comment --comment "SimpleHTTPServer"
sudo iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -m comment --comment "LoggingServer1"
sudo iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp --dport 1337 -j ACCEPT -m comment --comment "LoggingServer2"
sudo /sbin/service iptables save
sudo /sbin/service iptables restart

0 comments on commit a278759

Please sign in to comment.