forked from hoelsner/python-script-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.yaml
50 lines (45 loc) · 1.98 KB
/
setup.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
- hosts: localhost
gather_facts: False
tasks:
- name: Install packages required to run the examples
apt: pkg={{item}} state=installed
sudo: true
with_items:
- python3.4
- python-pip
- python3-pip
- ansible
- git
- build-essential
- python3-dev
- libssl-dev
- libffi-dev
- libxml2-dev
- libxslt1-dev
- name: install required python dependencies
sudo: true
pip: requirements=/vagrant/requirements.txt executable=pip3
# create a symlink in the home directory to the shared directory
- name: create 'examples' link
file: src=/vagrant dest=/home/vagrant/examples owner=vagrant group=vagrant state=link
# setup the jupyter notebook service
- name: ensure that the .jupyter directory exists
file: path=/home/vagrant/.jupyter state=directory
- name: create 'notebooks' link in the home directory
file: src=/vagrant/notebooks dest=/home/vagrant/notebooks owner=vagrant group=vagrant state=link
- name: copy jupyter notebook configuration file
copy: src=jupyter-config/jupyter_notebook_config.py dest=/home/vagrant/.jupyter/jupyter_notebook.config.py force=yes
- name: link about notebook
file: src=/vagrant/jupyter-config/about.ipynb dest=/home/vagrant/about.ipynb owner=vagrant group=vagrant state=link
# add startup script to enable the import notebook function
- name: verify that the profile directory exists
sudo: true
file: path=/home/vagrant/.ipython/profile_default/startup state=directory
- name: copy notebook import as startup script
copy: src=jupyter-config/10-nb-import-hook.py dest=/home/vagrant/.ipython/profile_default/startup/10-nb-import-hook.py force=yes
# install jupyter notebook as a service
- name: copy jupyter upstart script
copy: src=jupyter-config/jupyter-notebook.upstart dest=/etc/init/jupyter-notebook.conf force=yes
- name: start jupyter service
service: name=jupyter-notebook state=restarted enabled=yes