diff options
Diffstat (limited to 'Vagrantfile')
-rw-r--r-- | Vagrantfile | 135 |
1 files changed, 61 insertions, 74 deletions
diff --git a/Vagrantfile b/Vagrantfile index 99beeb2e..63846c3d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,123 +1,110 @@ -$script_sqlite = <<SCRIPT +$debian_script = <<SCRIPT apt-get update -apt-get install -y apache2 php5 php5-gd php5-curl php5-sqlite php5-xdebug +apt-get install -y apache2 php5 php5-gd php5-curl php5-sqlite php5-xdebug php5-ldap 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 -# install Composer -curl -s https://getcomposer.org/installer | php -sudo mv composer.phar /usr/local/bin/composer -# install PHPUnit -wget https://phar.phpunit.de/phpunit.phar -chmod +x phpunit.phar -sudo mv phpunit.phar /usr/local/bin/phpunit -phpunit --version -# Set kanboard dir as working dir -echo "cd /var/www/html" >> /home/vagrant/.bashrc -SCRIPT -$script_mysql = <<SCRIPT -export DEBIAN_FRONTEND=noninteractive -apt-get update -apt-get install -y apache2 php5 php5-gd php5-curl php5-mysql php5-xdebug mysql-server mysql-client -apt-get clean -y -echo "ServerName localhost" >> /etc/apache2/apache2.conf +sudo sed -ri 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf + +if [ -f /etc/apache2/sites-enabled/000-default ]; then + sudo sed -ri 's/AllowOverride None/AllowOverride All/g' /etc/apache2/sites-enabled/000-default +fi + +sudo a2enmod rewrite 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 -# install Composer -curl -s https://getcomposer.org/installer | php + +wget -q https://getcomposer.org/composer.phar +chmod +x composer.phar sudo mv composer.phar /usr/local/bin/composer -# install PHPUnit -wget https://phar.phpunit.de/phpunit.phar + +wget -q https://phar.phpunit.de/phpunit.phar chmod +x phpunit.phar sudo mv phpunit.phar /usr/local/bin/phpunit -phpunit --version -# Set kanboard dir as working dir -echo "cd /var/www/html" >> /home/vagrant/.bashrc + SCRIPT -$script_postgres = <<SCRIPT -export DEBIAN_FRONTEND=noninteractive -apt-get update -apt-get install -y apache2 php5 php5-gd php5-curl php5-pgsql php5-xdebug postgresql postgresql-contrib -apt-get clean -y -echo "ServerName localhost" >> /etc/apache2/apache2.conf -service apache2 restart -service postgresql restart +$centos_script = <<SCRIPT +sudo yum update -y +sudo yum install -y httpd php php-cli php-gd php-ldap php-mbstring php-mysql php-pdo php-pgsql php-xml wget + +sudo sed -ri 's/AllowOverride None/AllowOverride All/g' /etc/httpd/conf/httpd.conf + +if [ -x /usr/bin/systemctl ]; then + sudo systemctl restart httpd + sudo systemctl enable httpd + sudo chcon -R -t httpd_sys_content_rw_t /var/www/html/data + sudo setsebool -P httpd_can_network_connect=1 +else + sudo service httpd restart + sudo chkconfig httpd on +fi + rm -f /var/www/html/index.html date > /etc/vagrant_provisioned_at -# install Composer -curl -s https://getcomposer.org/installer | php + +wget -q https://getcomposer.org/composer.phar +chmod +x composer.phar sudo mv composer.phar /usr/local/bin/composer -# install PHPUnit -wget https://phar.phpunit.de/phpunit.phar + +wget -q https://phar.phpunit.de/phpunit.phar chmod +x phpunit.phar sudo mv phpunit.phar /usr/local/bin/phpunit -phpunit --version -# Set kanboard dir as working dir -echo "cd /var/www/html" >> /home/vagrant/.bashrc + SCRIPT 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 - - 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 - - config.vm.define "postgres" do |m| + config.vm.define "ubuntu" do |m| m.vm.box = "ubuntu/trusty64" - m.vm.provision "shell", inline: $script_postgres + m.vm.provision "shell", inline: $debian_script m.vm.synced_folder ".", "/var/www/html", owner: "www-data", group: "www-data" + m.vm.network :forwarded_port, guest: 80, host: 8001 end config.vm.define "debian8" do |m| m.vm.box = "debian/jessie64" - m.vm.provision "shell", inline: $script_sqlite + m.vm.provision "shell", inline: $debian_script m.vm.synced_folder ".", "/var/www/html", owner: "www-data", group: "www-data" + m.vm.network :forwarded_port, guest: 80, host: 8002 end config.vm.define "debian7" do |m| - m.vm.box = "chef/debian-7.6" - m.vm.provision "shell", inline: $script_sqlite + m.vm.box = "debian/wheezy64" + m.vm.provision "shell", inline: $debian_script m.vm.synced_folder ".", "/var/www", owner: "www-data", group: "www-data" + m.vm.network :forwarded_port, guest: 80, host: 8003 end config.vm.define "debian6" do |m| - m.vm.box = "chef/debian-6.0.10" - m.vm.provision "shell", inline: $script_sqlite + m.vm.box = "bento/debian-6.0.10" + m.vm.provision "shell", inline: $debian_script m.vm.synced_folder ".", "/var/www", owner: "www-data", group: "www-data" + m.vm.network :forwarded_port, guest: 80, host: 8004 end config.vm.define "centos7" do |m| - m.vm.box = "chef/centos-7.0" - m.vm.synced_folder ".", "/var/www/html", owner: "apache", group: "apache" + m.vm.box = "centos/7" + m.vm.provision "shell", inline: $centos_script + m.vm.synced_folder ".", "/var/www/html", owner: "apache", group: "apache", type: "rsync", + rsync__exclude: ".git/", rsync__auto: true + m.vm.network :forwarded_port, guest: 80, host: 8005 end - config.vm.define "centos65" do |m| - m.vm.box = "chef/centos-6.5" - m.vm.synced_folder ".", "/var/www/html", owner: "apache", group: "apache" + config.vm.define "centos6" do |m| + m.vm.box = "bento/centos-6.7" + m.vm.provision "shell", inline: $centos_script + m.vm.synced_folder ".", "/var/www/html", owner: "apache", group: "apache", type: "rsync", + rsync__exclude: ".git/", rsync__auto: true + m.vm.network :forwarded_port, guest: 80, host: 8006 end config.vm.define "freebsd10" do |m| m.vm.box = "freebsd/FreeBSD-10.2-STABLE" m.vm.base_mac = "080027D14C66" m.ssh.shell = "sh" + m.vm.network :forwarded_port, guest: 80, host: 8007 end - - config.vm.network :forwarded_port, guest: 80, host: 8001 - #config.vm.network "public_network", :bridge => "en0: Wi-Fi (AirPort)" end |