web_AI-5/Vagrantfile

45 lines
1.3 KiB
Plaintext
Raw Normal View History

2017-10-20 23:54:13 +02:00
# coding: utf-8
# -*- mode: ruby -*-
# vi: set ft=ruby :
BOX_IMAGE = "debian/stretch64"
Vagrant.configure("2") do |config|
config.vm.box = BOX_IMAGE
config.vm.hostname = "web-AI-5"
2017-10-29 17:02:57 +01:00
config.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
2017-10-20 23:54:13 +02:00
# Der Webserver ist unter http://localhost:8000 erreichbar
2017-11-18 09:44:14 +01:00
config.vm.network "forwarded_port", guest: 8000, host: 8000
config.vm.network "forwarded_port", guest: 80, host: 8080
2017-10-20 23:54:13 +02:00
#Diese Option würde erlauben den Server an ein virtuelles
#Netzwerk anzuschliessen.
#config.vm.network "private_network", type: "dhcp"
2017-10-29 20:27:02 +01:00
config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
2017-10-20 23:54:13 +02:00
#Begin des Installationsscripts
config.vm.provision "shell", inline: <<-SHELL
DEBIAN_FRONTEND=noninteractive
apt-get update
#zu installierende Pakete
2017-10-29 17:02:57 +01:00
apt-get install -y apache2 python3-django mariadb-server avahi-daemon \
libnss-mdns libapache2-mod-wsgi-py3 python3-mysqldb python3-pip
2017-12-27 19:33:29 +01:00
pip3 install django-extensions Pillow pyaml
2017-10-20 23:54:13 +02:00
#Copy the apache configuration for django to the correct place
cp /vagrant/apache/000-default.conf /etc/apache2/sites-available/
#restart the webserver
systemctl restart apache2.service
2017-12-25 22:50:42 +01:00
/vagrant/ansible/roles/web_AI-5/tasks/setup_script.sh
2017-10-20 23:54:13 +02:00
SHELL
end