diff --git a/roles/jupyter/tasks/jupyter.yml b/roles/jupyter/tasks/jupyter.yml index 591661f975e96cc6f02aa176d36e1e7631aac12c..569029dfc51eb3ddbb5d41faa248402373fc81cf 100644 --- a/roles/jupyter/tasks/jupyter.yml +++ b/roles/jupyter/tasks/jupyter.yml @@ -69,6 +69,28 @@ # Configure the docker-based Spawner. The /home/joyvan path is what the Jupyter # Docker images use. c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner' + c.JupyterHub.load_roles = [ + { + "name": "jupyterhub-idle-culler-role", + "scopes": [ + "list:users", + "read:users:activity", + "read:servers", + "delete:servers", + ], + "services": ["jupyterhub-idle-culler-service"], + } + ] + c.JupyterHub.services = [ + { + "name": "jupyterhub-idle-culler-service", + "command": [ + sys.executable, + "-m", "jupyterhub_idle_culler", + "--timeout=3600", + ], + } + ] c.DockerSpawner.notebook_dir = '/home/jovyan/work' # This creates a volume for each user to store their notebooks. As an alternative, # we could bind-mount local filesystem paths (but something must create them first).