Skip to content

Commit 02e9c4d

Browse files
committed
added HACKING_WITH_VAGRANT and added loading fixtures with ansible
1 parent 971c41f commit 02e9c4d

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

HACKING_WITH_VAGRANT

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
enter the VM with:
2+
$ vagrant ssh
3+
4+
the following commands have to be executed inside the VM!
5+
6+
1) after provisioning the VM you have to set the 'admin' superuser password manually
7+
$ ./manage.py changepassword admin
8+
9+
2) start the server bound on all interfaces instead of 127.0.0.1 only
10+
$ ./manage.py runserver 0.0.0.0:8000

provision_vagrant.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,28 @@
22
- hosts: all
33
sudo: yes
44
tasks:
5+
- name: link /mos -> /vagrant
6+
file: src=/vagrant
7+
dest=/mos
8+
state=link
9+
10+
# check the existence of the secret_key.py file
11+
- stat: path=/mos/mos/settings/secret_key.py
12+
register: st
13+
- fail: msg="Error! secret_key.py file not found in mos/settings folder (create one with content SECRET_KEY='start123')"
14+
when: st.stat.exists == False
15+
16+
# update / install packages
517
- apt: update_cache=yes
18+
619
# - apt: pkg=python-dev
720
- apt: pkg=build-essential
821
# - apt: pkg=python-pip
922

23+
# install required python modules
1024
- pip: requirements=/vagrant/requirements.txt
1125
- pip: requirements=/vagrant/requirements-dev.txt
1226

13-
- name: link /mos -> /vagrant
14-
file: src=/vagrant
15-
dest=/mos
16-
state=link
17-
1827
# - name: add locale de_DE
1928
# lineinfile: dest=/etc/locale.gen
2029
# regexp='^#\s*(de_DE.UTF-8\s*UTF-8)'
@@ -26,9 +35,21 @@
2635

2736
# sudo DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales
2837

29-
- name: syncdb
38+
39+
# prepare MOS itself
40+
- name: django syncdb
3041
django_manage: app_path=/mos
3142
command=syncdb
3243

44+
- name: django migrate
45+
django_manage: app_path=/mos
46+
command=migrate
47+
48+
- name: django loaddata
49+
django_manage: app_path=/mos
50+
fixtures='core/fixtures/default_choices.json members/fixtures/default_choices.json members/fixtures/dummy_members.json cal/fixtures/events_2012-09-20.json'
51+
command=loaddata
52+
53+
# set the default directory to /mos
3354
- lineinfile: dest=/home/vagrant/.bashrc
3455
line='cd /mos'

0 commit comments

Comments
 (0)