diff --git a/roles/jupyter/defaults/main.yml b/roles/jupyter/defaults/main.yml new file mode 100644 index 000000000..017b0de30 --- /dev/null +++ b/roles/jupyter/defaults/main.yml @@ -0,0 +1,2 @@ +notebook_dir: /opt/iiab/notebook +jupyter_venv: /opt/iiab/jupyter diff --git a/roles/jupyter/tasks/install.yml b/roles/jupyter/tasks/install.yml new file mode 100644 index 000000000..3330ba743 --- /dev/null +++ b/roles/jupyter/tasks/install.yml @@ -0,0 +1,17 @@ +- name: Make the directories to hold notebooks + file: + state: directory + path: '{{ notebook_dir }}' + +- name: Use pip to install into a virtual environment + pip: + name: + - jupyterlab + #- jupyter_vim + virtualenv: "{{ jupyter_venv }}" # /opt/iiab/jupyter + virtualenv_site_packages: no + virtualenv_command: /usr/bin/virtualenv + virtualenv_python: python3 + extra_args: "--no-cache-dir" + when: internet_available + diff --git a/roles/jupyter/tasks/main.yml b/roles/jupyter/tasks/main.yml new file mode 100644 index 000000000..9f1804b38 --- /dev/null +++ b/roles/jupyter/tasks/main.yml @@ -0,0 +1,23 @@ +- name: Install Jupyter if jupyter_installed not defined, e.g. in {{ iiab_state_file }} # /etc/iiab/iiab_state.yml + include_tasks: install.yml + when: jupyter_installed is undefined + + +#- include_tasks: enable-or-disable.yml + + +- name: Add 'jupyter' variable values to {{ iiab_ini_file }} + ini_file: + path: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini + section: jupyter + option: "{{ item.option }}" + value: "{{ item.value | string }}" + with_items: + - option: name + value: Jupyter + - option: description + value: '"Raspberry Pi Jupyter python programming environment"' + - option: install + value: "{{ jupyter_install }}" + - option: enabled + value: "{{ jupyter_enabled }}" diff --git a/vars/default_vars.yml b/vars/default_vars.yml index c932b98a6..d1fb036e1 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -564,8 +564,8 @@ phpmyadmin_enabled: False vnstat_install: False vnstat_enabled: False -jupyterhub_install: False -jupyterhub_enabled: False +jupyter_install: False +jupyter_enabled: False # 9-LOCAL-ADDONS