Skip to content

Commit f210ef3

Browse files
committed
add vagrant provisioned by ansible
1 parent 93064e3 commit f210ef3

File tree

8 files changed

+84
-2
lines changed

8 files changed

+84
-2
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ build
55
_build
66
*.log
77
.DS*
8-
8+
.vagrant/

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,15 @@
1212

1313
This package contains several tools for projects and data management in the [National Genomics Infrastructure](https://portal.scilifelab.se/genomics/) in Stockholm, Sweden.
1414

15+
### Install for development
16+
You can setup a demo/development environment using [Vagrant][vagrant] provisioned by [Ansible][ansible].
17+
18+
```bash
19+
$ ansible-galaxy install robinandeer.miniconda
20+
$ vagrant up && vagrant ssh
21+
22+
# [inside virtual machince]
23+
$ bash /vagrant/provisioning/run-me.sh
24+
```
25+
1526
For a more detailed documentation please go to [the documentation page](http://taca.readthedocs.org/en/latest/).

Vagrantfile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5+
VAGRANTFILE_API_VERSION = "2"
6+
7+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8+
# All Vagrant configuration is done here. The most common configuration
9+
# options are documented and commented below. For a complete reference,
10+
# please see the online documentation at vagrantup.com.
11+
12+
# Every Vagrant virtual environment requires a box to build off of.
13+
config.vm.box = "phusion/ubuntu-14.04-amd64"
14+
15+
# Provision with Ansible
16+
config.vm.provision "ansible" do |ansible|
17+
ansible.playbook = "provisioning/playbook.yml"
18+
end
19+
20+
# Create a forwarded port mapping which allows access to a specific port
21+
# within the machine from a port on the host machine. In the example below,
22+
# accessing "localhost:8080" will access port 80 on the guest machine.
23+
# config.vm.network "forwarded_port", guest: 80, host: 8080
24+
25+
# If true, then any SSH connections made will enable agent forwarding.
26+
# Default value: false
27+
# config.ssh.forward_agent = true
28+
end

provisioning/playbook.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
- hosts: all
3+
remote_user: vagrant
4+
sudo: yes
5+
roles:
6+
- common
7+
- robinandeer.miniconda
8+
9+
vars:
10+
miniconda_modify_bashrc: yes
11+
miniconda_environments:
12+
- name: develop
13+
python_version: 2.7
14+
pkgs: 'pip ipython setuptools'
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
- name: upgrade apt
3+
sudo: yes
4+
apt: upgrade=yes
5+
6+
- name: install base packages
7+
apt: name={{ item }} update_cache={{ update_apt_cache }} force=yes state=installed
8+
with_items:
9+
- build-essential
10+
- git
11+
- python-dev
12+
- python-pip
13+
- python-pycurl
14+
- python-virtualenv
15+
- supervisor
16+
- wget
17+
- vim
18+
- tmux
19+
tags: packages
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
update_apt_cache: no

provisioning/run-me.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# activate environment
2+
source activate develop
3+
4+
# install development dependencies
5+
cd /vagrant
6+
pip install -r ./requirements-dev.txt
7+
8+
# install the package for development
9+
python setup.py develop

requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
click
22
requests
33
pyyaml
4-
statusdb

0 commit comments

Comments
 (0)