Skip to content

Commit

Permalink
#30: launch jupyter notebook from ansible playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenwh committed Jul 4, 2019
1 parent 91ae0ba commit dd53101
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions provisioning/roles/openwind/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@
- name: openwind | Add PYTHONPATH to bashrc
lineinfile: dest="/home/vagrant/.bashrc" line="export PYTHONPATH=/vagrant"

- name: openwind | Change owner of anaconda directory
shell: 'sudo chown -R vagrant /home/vagrant/anaconda/'

- name: openwind | Add Jupyter Notebook to crontab
cron: name="Jupyter Notebook" special_time=reboot job="sleep 60; {{ conda_dir }}/envs/{{ env_name }}/bin/jupyter-notebook --ip=0.0.0.0 --no-browser --notebook-dir={{ dev_sources_dir }}/notebooks/ --NotebookApp.token=vagrant"

- name: openwind | Check if Jupyter is running
shell: ps aux | grep jupyter | grep -v grep
ignore_errors: yes
changed_when: false
register: jupyter_status

- name: openwind | Launch Jupyter Notebook
shell: "nohup {{ conda_dir }}/envs/{{ env_name }}/bin/jupyter-notebook --ip=0.0.0.0 --no-browser --notebook-dir={{ dev_sources_dir }}/notebooks/ --NotebookApp.token=vagrant > /dev/null 2>&1 &"
when: jupyter_status.rc != 0

#- name: Nansat Setup Python | Check if numpy is imported
# shell: "nosetests test_import.py"
# args:
# chdir: "{{ shared_dir }}"

#- name: openwind | Update/checkout Nansat
# git: repo=https://github.com/nansencenter/nansat
# dest="{{ dev_sources_dir }}/nansat/"
Expand Down

0 comments on commit dd53101

Please sign in to comment.