mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
Found instructions for the Littlest Jupyterhub
This commit is contained in:
parent
17a6d030f7
commit
e91319bb27
4 changed files with 53 additions and 4 deletions
25
roles/jupyter/tasks/enable-or-disable.yml
Normal file
25
roles/jupyter/tasks/enable-or-disable.yml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
- name: systemd daemon-reload
|
||||||
|
systemd:
|
||||||
|
daemon_reload: yes
|
||||||
|
|
||||||
|
|
||||||
|
# enable or disable
|
||||||
|
- name: Enable & Restart jupyterhub
|
||||||
|
systemd:
|
||||||
|
name: "{{ item }}"
|
||||||
|
enabled: yes
|
||||||
|
state: restarted
|
||||||
|
with_items:
|
||||||
|
- jupyter
|
||||||
|
when: jupyter_enabled
|
||||||
|
|
||||||
|
- name: Disable jupyterhub
|
||||||
|
systemd:
|
||||||
|
name: "{{ item }}"
|
||||||
|
enabled: no
|
||||||
|
state: stopped
|
||||||
|
with_items:
|
||||||
|
- jupyter
|
||||||
|
when: not jupyter_enabled
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
- name: Make the directories to hold notebooks
|
- name: Make the directories to hold notebooks
|
||||||
file:
|
file:
|
||||||
state: directory
|
state: directory
|
||||||
path: '{{ notebook_dir }}'
|
path: '{{ item }}'
|
||||||
|
with_items:
|
||||||
|
- '{{ notebook_dir }}/etc/jupyter'
|
||||||
|
- '{{ notebook_dir }}/etc/jupyterhub'
|
||||||
|
- '{{ notebook_dir }}/etc/systemd'
|
||||||
|
|
||||||
- name: Use pip to install into a virtual environment
|
- name: Use pip to install into a virtual environment
|
||||||
pip:
|
pip:
|
||||||
name:
|
name:
|
||||||
- jupyterlab
|
- pip
|
||||||
#- jupyter_vim
|
|
||||||
virtualenv: "{{ jupyter_venv }}" # /opt/iiab/jupyter
|
virtualenv: "{{ jupyter_venv }}" # /opt/iiab/jupyter
|
||||||
virtualenv_site_packages: no
|
virtualenv_site_packages: no
|
||||||
virtualenv_command: /usr/bin/virtualenv
|
virtualenv_command: /usr/bin/virtualenv
|
||||||
|
@ -15,3 +18,13 @@
|
||||||
extra_args: "--no-cache-dir"
|
extra_args: "--no-cache-dir"
|
||||||
when: internet_available
|
when: internet_available
|
||||||
|
|
||||||
|
- name: Fetch the Littlest JupyterHub code
|
||||||
|
ansible.builtin.git:
|
||||||
|
repo: '{{ jupyterhub_url }}
|
||||||
|
dest: '{{ jupyter_venv }}'
|
||||||
|
|
||||||
|
- name: Install a bootstrap.py that permits installation on other than Ubunt
|
||||||
|
template:
|
||||||
|
src: bootstrap.py
|
||||||
|
dest: '{{ jupyter_venv }}'
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
when: jupyter_installed is undefined
|
when: jupyter_installed is undefined
|
||||||
|
|
||||||
|
|
||||||
#- include_tasks: enable-or-disable.yml
|
- include_tasks: enable-or-disable.yml
|
||||||
|
|
||||||
|
|
||||||
- name: Add 'jupyter' variable values to {{ iiab_ini_file }}
|
- name: Add 'jupyter' variable values to {{ iiab_ini_file }}
|
||||||
|
|
11
roles/jupyter/templates/jupyter.service
Normal file
11
roles/jupyter/templates/jupyter.service
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[Unit]
|
||||||
|
Description=JupyterHub
|
||||||
|
After=syslog.target network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=hubuser
|
||||||
|
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/iiab/jupyterhub/bin"
|
||||||
|
ExecStart=/opt/iiab/jupyterhub/bin/jupyterhub -f /opt/iiab/jupyterhub/etc/jupyterhub/jupyterhub_config.py
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in a new issue