1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

systemd spawner is working writing to /var/lib/private

This commit is contained in:
George Hunt 2021-03-10 03:10:49 +00:00
parent 09904517e5
commit c2ef5999a7
3 changed files with 26 additions and 6 deletions

View file

@ -1,4 +1,9 @@
- name: Make the directories to hold notebooks - name: We need a non-privileged user to write all the notebooks
ansible.builtin.user:
name: web-user
home: /opt/iiab/notebooks
- name: Make the directories to hold jupyter config
file: file:
state: directory state: directory
path: '{{ item }}' path: '{{ item }}'
@ -7,6 +12,12 @@
- '{{ jupyter_venv }}/etc/jupyterhub' - '{{ jupyter_venv }}/etc/jupyterhub'
- '{{ jupyter_venv }}/etc/systemd' - '{{ jupyter_venv }}/etc/systemd'
- name: Make a directory to hold notebooks
file:
state: directory
path: /opt/iiab/notebooks
owner: web-user
- name: "Set 'nodejs_install: True' and 'nodejs_enabled: True'" - name: "Set 'nodejs_install: True' and 'nodejs_enabled: True'"
set_fact: set_fact:
nodejs_install: True nodejs_install: True
@ -35,6 +46,8 @@
- ipywidgets - ipywidgets
- jupyterhub - jupyterhub
- jupyterlab - jupyterlab
- jupyterhub_firstuseauthenticator
- jupyterhub-systemdspawner
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
@ -45,7 +58,7 @@
- name: Install the config file for jupyterhub - name: Install the config file for jupyterhub
template: template:
src: jupyterhub_config.py src: jupyterhub_config.py
dest: '{{ jupyter_venv }}/env/jupyterhub/' dest: '{{ jupyter_venv }}/etc/jupyterhub/'
- name: Use systemd to start jupyterhub - name: Use systemd to start jupyterhub
template: template:
src: jupyter.service src: jupyter.service

View file

@ -3,7 +3,7 @@ Description=JupyterHub
After=syslog.target network.target After=syslog.target network.target
[Service] [Service]
User=hubuser User=root
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:{{ jupyter_venv }}/bin" Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:{{ jupyter_venv }}/bin"
ExecStart={{ jupyter_venv }}/bin/jupyterhub -f {{ jupyter_venv }}/etc/jupyterhub/jupyterhub_config.py ExecStart={{ jupyter_venv }}/bin/jupyterhub -f {{ jupyter_venv }}/etc/jupyterhub/jupyterhub_config.py

View file

@ -114,7 +114,7 @@
# - dummy: jupyterhub.auth.DummyAuthenticator # - dummy: jupyterhub.auth.DummyAuthenticator
# - pam: jupyterhub.auth.PAMAuthenticator # - pam: jupyterhub.auth.PAMAuthenticator
# Default: 'jupyterhub.auth.PAMAuthenticator' # Default: 'jupyterhub.auth.PAMAuthenticator'
# c.JupyterHub.authenticator_class = 'jupyterhub.auth.PAMAuthenticator' c.JupyterHub.authenticator_class = 'firstuseauthenticator.FirstUseAuthenticator'
## The base URL of the entire application. ## The base URL of the entire application.
# #
@ -194,7 +194,7 @@
# #
# Should be exactly 256 bits (32 bytes). # Should be exactly 256 bits (32 bytes).
# Default: b'' # Default: b''
# c.JupyterHub.cookie_secret = b'' c.JupyterHub.cookie_secret = b'helloiiabitsrainingb123456789012'
## File in which to store the cookie secret. ## File in which to store the cookie secret.
# Default: 'jupyterhub_cookie_secret' # Default: 'jupyterhub_cookie_secret'
@ -589,7 +589,7 @@
# - localprocess: jupyterhub.spawner.LocalProcessSpawner # - localprocess: jupyterhub.spawner.LocalProcessSpawner
# - simple: jupyterhub.spawner.SimpleLocalProcessSpawner # - simple: jupyterhub.spawner.SimpleLocalProcessSpawner
# Default: 'jupyterhub.spawner.LocalProcessSpawner' # Default: 'jupyterhub.spawner.LocalProcessSpawner'
# c.JupyterHub.spawner_class = 'jupyterhub.spawner.LocalProcessSpawner' c.JupyterHub.spawner_class = 'systemdspawner.SystemdSpawner'
## Path to SSL certificate file for the public facing interface of the proxy ## Path to SSL certificate file for the public facing interface of the proxy
# #
@ -1229,3 +1229,10 @@
## Maximum number of entries per page for paginated results. ## Maximum number of entries per page for paginated results.
# Default: 250 # Default: 250
# c.Pagination.max_per_page = 250 # c.Pagination.max_per_page = 250
#------------------------------------------------------------------------------
# Systemdspawner config
#------------------------------------------------------------------------------
c.SystemdSpawner.dynamic_users = True
c.SystemdSpawner.user_workingdir = '/opt/iiab/notebooks/{USERNAME}'