diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-10-25 14:41:30 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-10-25 14:41:30 -0400 |
commit | 471736bf8c9304606f183cd6b688b1fae64eea70 (patch) | |
tree | 3730e2fbee77226f740f2f8d9d67d06446d452ca /Vagrantfile | |
parent | c48cb658ff31cab1cd35215e3a745620c4db186e (diff) |
Change Vagrant config to have multiple boxes
Diffstat (limited to 'Vagrantfile')
-rw-r--r-- | Vagrantfile | 77 |
1 files changed, 57 insertions, 20 deletions
diff --git a/Vagrantfile b/Vagrantfile index ced296a1..2aab5897 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,34 +1,71 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : -VAGRANTFILE_API_VERSION = "2" +$script_sqlite = <<SCRIPT +apt-get update +apt-get install -y apache2 php5 php5-sqlite php5-xdebug +apt-get clean -y +echo "ServerName localhost" >> /etc/apache2/apache2.conf +service apache2 restart +rm -f /var/www/html/index.html +date > /etc/vagrant_provisioned_at +SCRIPT -$script = <<SCRIPT -# install packages +$script_mysql = <<SCRIPT +export DEBIAN_FRONTEND=noninteractive apt-get update -apt-get install -y apache2 php5 libapache2-mod-php5 php5-sqlite php5-ldap php5-xdebug php5-curl php5-mysql php5-pgsql +apt-get install -y apache2 php5 php5-mysql php5-xdebug mysql-server mysql-client +apt-get clean -y +echo "ServerName localhost" >> /etc/apache2/apache2.conf service apache2 restart +service mysql restart +echo "create database kanboard;" | mysql -u root rm -f /var/www/html/index.html date > /etc/vagrant_provisioned_at -echo "Go to http://localhost:8080/ (admin/admin) !" SCRIPT -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| +$script_postgres = <<SCRIPT +export DEBIAN_FRONTEND=noninteractive +apt-get update +apt-get install -y apache2 php5 php5-pgsql php5-xdebug postgresql postgresql-contrib +apt-get clean -y +echo "ServerName localhost" >> /etc/apache2/apache2.conf +service apache2 restart +service postgresql restart +rm -f /var/www/html/index.html +date > /etc/vagrant_provisioned_at +SCRIPT - # Virtualbox - config.vm.provider "virtualbox" do |v| - v.memory = 1024 +Vagrant.configure("2") do |config| + + config.vm.define "sqlite" do |m| + m.vm.box = "ubuntu/trusty64" + m.vm.provision "shell", inline: $script_sqlite + m.vm.synced_folder ".", "/var/www/html", owner: "www-data", group: "www-data" end - # Image - config.vm.box = "ubuntu/trusty64" - config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" + config.vm.define "mysql" do |m| + m.vm.box = "ubuntu/trusty64" + m.vm.provision "shell", inline: $script_mysql + m.vm.synced_folder ".", "/var/www/html", owner: "www-data", group: "www-data" + end - # Network - config.vm.network :forwarded_port, guest: 80, host: 8080 - #config.vm.network "public_network", :bridge => "en0: Wi-Fi (AirPort)" + config.vm.define "postgres" do |m| + m.vm.box = "ubuntu/trusty64" + m.vm.provision "shell", inline: $script_postgres + m.vm.synced_folder ".", "/var/www/html", owner: "www-data", group: "www-data" + end - # Setup - config.vm.provision "shell", inline: $script - config.vm.synced_folder ".", "/var/www/html", owner: "www-data", group: "www-data" + config.vm.define "debian7" do |m| + m.vm.box = "chef/debian-7.6" + m.vm.provision "shell", inline: $script_sqlite + m.vm.synced_folder ".", "/var/www", owner: "www-data", group: "www-data" + end + + config.vm.define "debian6" do |m| + m.vm.box = "chef/debian-6.0.10" + m.vm.provision "shell", inline: $script_sqlite + m.vm.synced_folder ".", "/var/www", owner: "www-data", group: "www-data" + end + + config.vm.network :forwarded_port, guest: 80, host: 8001 + #config.vm.network "public_network", :bridge => "en0: Wi-Fi (AirPort)" end |