Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ansible-roles
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jocelyn Delalande
ansible-roles
Commits
c8a296a9
Commit
c8a296a9
authored
Oct 20, 2017
by
Jocelyn Delalande
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jupyterhub: Turn into a functional role !
parent
f31e8630
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
2 deletions
+41
-2
jupyterhub/handlers/main.yml
jupyterhub/handlers/main.yml
+5
-0
jupyterhub/tasks/main.yml
jupyterhub/tasks/main.yml
+24
-1
jupyterhub/templates/jupyterhub.service.j2
jupyterhub/templates/jupyterhub.service.j2
+1
-1
jupyterhub/templates/jupyterhub_config.py.j2
jupyterhub/templates/jupyterhub_config.py.j2
+11
-0
No files found.
jupyterhub/handlers/main.yml
0 → 100644
View file @
c8a296a9
-
name
:
restart jupyterhub
service
:
name=jupyterhub state=restarted
-
name
:
reload systemd
command
:
systemctl daemon-reload
\ No newline at end of file
jupyterhub/tasks/main.yml
View file @
c8a296a9
...
...
@@ -47,13 +47,36 @@
entry
:
"
user:jupyterhub:r"
state
:
present
-
name
:
authorize jupyterhub to log events in lastlog
acl
:
path
:
/var/log/lastlog
entry
:
"
user:jupyterhub:rw"
state
:
present
-
name
:
make sure dedicated ro-dirs exist
file
:
path={{item}}/ state=directory owner=root mode=0755
with_items
:
-
/etc/jupyterhub
-
/etc/jupyter/templates
-
name
:
make sure dedicated rw-dirs exist
file
:
path={{ item }} state=directory owner=jupyterhub mode=0755
with_items
:
-
/var/log/jupyterhub
-
name
:
install custom config file
template
:
src
:
jupyterhub_config.py.j2
dest
:
/etc/jupyter/jupyterhub_config.py
notify
:
restart jupyterhub
-
name
:
systemd script is in place
template
:
src
:
jupyterhub.service.j2
dest
:
/etc/systemd/system/jupyterhub.service
notify
:
-
restart jupyterhub
-
reload systemd
-
restart jupyterhub
-
name
:
jupyterhub is started
service
:
name=jupyterhub state=started
\ No newline at end of file
jupyterhub/templates/jupyterhub.service.j2
View file @
c8a296a9
...
...
@@ -4,7 +4,7 @@ After=network.target
[Service]
WorkingDirectory=/opt/jupyterhub/
ExecStart=/opt/jupyterhub/venv/bin/jupyterhub --JupyterHub.spawner_class=sudospawner.SudoSpawner
ExecStart=/opt/jupyterhub/venv/bin/jupyterhub --JupyterHub.spawner_class=sudospawner.SudoSpawner
-f /etc/jupyterhub/jupyterhub_config.py
User=jupyterhub
[Install]
...
...
jupyterhub/templates/jupyterhub_config.py.j2
0 → 100644
View file @
c8a296a9
# {{ ansible_managed }}
# Configuration file for jupyterhub.
## Avoid listening on iternet (we have a nginx for that)
c.JupyterHub.ip = '127.0.0.1'
## Use our in-venv sudospawner
c.SudoSpawner.sudospawner_path = '/opt/jupyterhub/venv/bin/sudospawner'
## Restrict users able to log in to a unix group
c.PAMAuthenticator.group_whitelist = ['jupyterhub-users']
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment