diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..2d2db58 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,42 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : +BOX_IMAGE = "debian/stretch64" +Vagrant.configure("2") do |config| + + config.vm.define "web" do |subconfig| + subconfig.vm.box = BOX_IMAGE + subconfig.vm.hostname = "web" + subconfig.vm.network "forwarded_port", guest: 80, host: 8080 + subconfig.vm.network "private_network", type: "dhcp" + subconfig.vm.provision "shell", inline: <<-SHELL + DEBIAN_FRONTEND=noninteractive + apt-get install -y php7.0 php7.0-mysql php7.0-xml mariadb-server + phpenmod mysqli + mysql < /vagrant/sql/remove_db.sql + mysql < /vagrant/sql/create_db.sql + mysql < /vagrant/sql/add_data.sql + if ! [ -L /var/www/html ]; then + rm -rf /var/www/html + ln -s /vagrant /var/www/html + fi + SHELL + end + + config.vm.define "resources" do |subconfig| + subconfig.vm.box = BOX_IMAGE + subconfig.vm.hostname = "resources" + subconfig.vm.network "private_network", type: "dhcp" + subconfig.vm.provision "shell", inline: <<-SHELL + apt-get install -y git + SHELL + end + + # Enable provisioning with a shell script. Additional provisioners such as + # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the + # documentation for more information about their specific syntax and use. + config.vm.provision "shell", inline: <<-SHELL + apt-get update + apt-get install -y apache2 avahi-daemon libnss-mdns + SHELL + +end