File tree Expand file tree Collapse file tree 10 files changed +79
-5
lines changed
Expand file tree Collapse file tree 10 files changed +79
-5
lines changed Original file line number Diff line number Diff line change 11.gondor
2+ .vagrant
23* .pyc
34pythonkc_site /pythonkc.sqlite
45pythonkc_site /local_settings.py
Original file line number Diff line number Diff line change 22
33Files for the PythonKC.com website.
44
5- ## Development Quickstart
5+ ## Development Quickstart Option 1 (vagrant)
6+
7+ ```
8+ vagrant plugin install vagrant-hostmanager
9+ vagrant plugin install vagrant-vbguest
10+ vagrant up
11+ ```
12+
13+ ` vagrant up ` will run ` provision.sh ` which runs ansible on the VM.
14+
15+ We've done this so you don't have to install ansible on your local machine.
16+
17+ If you'd prefer you can always ssh in and run/re-run the provisioner manually
18+ (the output is a little nicer this way):
19+
20+ ```
21+ vagrant ssh
22+ cd ~/vagrant/ansible
23+ ansible-playbook vagrant.yml
24+ ```
25+
26+ ## Development Quickstart Option 2 (virtualenv)
27+
628```
729mkvirtualenv pythonkc
830git clone git@github.com:pythonkc/pythonkc.com.git
Original file line number Diff line number Diff line change 1+ [defaults]
2+ hostfile = ./hosts
3+ transport = ssh
Original file line number Diff line number Diff line change 1+ ---
2+ example : true # TODO, put any common variables in here
Original file line number Diff line number Diff line change 1+ ---
2+ user : pythonkc
Original file line number Diff line number Diff line change 1+ ---
2+ user : vagrant
Original file line number Diff line number Diff line change 1+ [vagrant]
2+ localhost ansible_connection=local
3+
4+ # TODO
5+ # [production]
6+ # pythonkc.com
Original file line number Diff line number Diff line change 1+ ---
2+ - name : Update apt
3+ apt : update_cache=yes cache_valid_time=3600
4+ tags : apt
5+
6+ - name : Install some base packages
7+ apt : pkg="{{item}}" state=latest
8+ tags : apt
9+ with_items :
10+ - build-essential
11+ - python3
12+ - python3-dev
13+ - python3-pip
14+ - python3-software-properties
15+
16+ # What else should go in here?
17+ # vim + vim configuration for python?
Original file line number Diff line number Diff line change 1+ ---
2+ - hosts : vagrant
3+ sudo : yes
4+
5+ # you can have tasks right here
6+ tasks :
7+ - name : Say hello
8+ shell : echo `date` > /home/vagrant/hello.txt
9+
10+ # and you can have 'roles'
11+ roles :
12+ - role : base
13+ tags : base_role
14+
Original file line number Diff line number Diff line change 33
44export DEBIAN_FRONTEND=noninteractive
55
6- aptitude update
7- aptitude dist-upgrade -y
8- aptitude install -y python3 python3-dev python3-pip ansible
96ln -sf /vagrant /home/vagrant/
10- # TODO: Run Ansible playbooks
7+
8+ if [[ -z " $( which ansible) " ]]; then
9+ echo " Installing ansible"
10+ aptitude update
11+ aptitude install -y python3 python3-dev python3-pip ansible
12+ fi
13+
14+ cd /home/vagrant/vagrant/ansible
15+ ansible-playbook vagrant.yml
You can’t perform that action at this time.
0 commit comments