4
4
# This is the Vagrant config file for setting up an environment for Isso development.
5
5
# It requires:
6
6
#
7
- # * Vagrant (http ://vagrantup.com)
8
- # * A VM engine, like VirtualBox (http ://virtualbox.org)
7
+ # * Vagrant (https ://vagrantup.com)
8
+ # * A VM engine, like VirtualBox (https ://virtualbox.org)
9
9
# * The Vagrant-Hostmanager plugin (https://github.com/smdahlen/vagrant-hostmanager)
10
+ # * Ansible (https://www.ansible.com)
10
11
#
11
12
# With them installed, cd into this directory and do 'vagrant up'. It's possible Vagrant will
12
13
# ask for your root password so it can update your /etc/hosts file. Once it's happily churning out
17
18
# to get into the VM. Useful info about it:
18
19
#
19
20
# * Running Ubuntu 14.04
20
- # * Isso is running on uWSGI via port 8080
21
- # * Actual webserver is Apache2, using mod_proxy_uwsgi to talk to uWSGI
22
- # * uWSGI log file is /tmp/uwsgi.log
23
- # * Isso DB file is /tmp/isso/comments.db
24
- # * Isso log file is /tmp/isso/isso.log
21
+ # * Isso is running on uWSGI
22
+ # * Actual webserver is Nginx to talk to uWSGI over a unix socket
23
+ # * uWSGI log file is /var/log/uwsgi/apps/isso.log
24
+ # * Isso DB file is /var/isso/comments.db
25
+ # * Isso log file is /var/log/isso.log
26
+ #
27
+ # When the VM is getting rebooted vagrant mounts the shared folder after uWSGI is getting startet. To fix this issue for
28
+ # the moment you need to 'vagrant ssh' into the VM and execute 'sudo service uwsgi restart'.
25
29
#
26
30
# Enjoy!
27
31
28
- $bootstrap = <<BOOTSTRAP
29
- apt-get update
30
- apt-get install -y apache2 curl build-essential python-setuptools python-dev sqlite3 git python-pip
31
- a2enmod proxy
32
- service apache2 restart
33
-
34
- curl -sL https://deb.nodesource.com/setup | bash -
35
- apt-get install -y nodejs
36
-
37
- npm install -g bower requirejs uglify-js jade
38
-
39
- cd /vagrant
40
- python setup.py develop
41
- make init
42
- make js
43
-
44
- ln -s /vagrant/isso/demo /var/www/isso
45
-
46
- pip install uwsgi
47
- mkdir -p /tmp/isso/spool
48
-
49
- uwsgi --socket 127.0.0.1:8080 --master --processes 4 --cache2 name=hash,items=1024,blocksize=32 --spooler /tmp/isso/spool --module isso.run --env ISSO_SETTINGS=/vagrant/share/isso-dev.conf --daemonize /tmp/uwsgi.log --py-autoreload 1
50
- chmod a+r /tmp/uwsgi.log
51
-
52
- apt-get install libapache2-mod-proxy-uwsgi
53
-
54
- cp /vagrant/share/isso-dev.local.apache-conf /etc/apache2/sites-available/isso-dev.local.conf
55
- a2ensite isso-dev.local
56
- a2dissite 000-default
57
- service apache2 restart
58
-
59
- BOOTSTRAP
60
-
61
32
Vagrant . configure ( 2 ) do |config |
62
33
63
34
# The most common configuration options are documented and commented below.
@@ -81,7 +52,11 @@ Vagrant.configure(2) do |config|
81
52
( ip = /inet addr:(\d +\. \d +\. \d +\. \d )/ . match ( result ) ) && ip [ 1 ]
82
53
end
83
54
84
- config . vm . provision "shell" , inline : $bootstrap
55
+ config . vm . provision "ansible" do |ansible |
56
+ ansible . playbook = "ansible/site.yml"
57
+ ansible . limit = "all"
58
+ ansible . verbose = "v"
59
+ end
85
60
86
61
config . vm . post_up_message = "Browse to http://isso-dev.local/demo/index.html to start."
87
62
end
0 commit comments