Skip to content

Commit

Permalink
port configurable, #537
Browse files Browse the repository at this point in the history
  • Loading branch information
landam committed Mar 18, 2023
1 parent 0dc7d46 commit 2e3de32
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
8 changes: 8 additions & 0 deletions system/roles/service-jupyterhub/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---

- name: service jupyterhub restart
service:
name: jupyterhub
state: restarted

# vim: set ts=8 sts=2 sw=2 et:
18 changes: 18 additions & 0 deletions system/roles/service-jupyterhub/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,22 @@
install_recommends: no
state: latest

- name: Configure JupyterHub service
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- {
src: jupyterhub/gislab.py.j2,
dest: /etc/jupyterhub/config/jupyterhub_config.d/gislab.py
}
- {
src: systemd/jupyterhub.service.j2,
dest: /etc/systemd/system/jupyterhub.service
}
notify:
- service jupyterhub restart

- meta: flush_handlers

# vim: set ts=8 sts=2 sw=2 et:
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c.JupyterHub.bind_url = 'http://:{{ jupyterhub_port }}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]

[Service]
User=root
Restart=always
WorkingDirectory=/var/lib/jupyterhub
PrivateTmp=yes
PrivateDevices=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ExecStart=/usr/bin/python3 -m jupyterhub.app -f /etc/jupyterhub/config/jupyterhub_config.d/gislab.py --upgrade-db


[Install]
WantedBy=multi-user.target
3 changes: 3 additions & 0 deletions system/roles/service-jupyterhub/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---

jupyterhub_port: 8000

0 comments on commit 2e3de32

Please sign in to comment.