Skip to content
Snippets Groups Projects
Commit 10758cce authored by Daniel Müller's avatar Daniel Müller :speech_balloon:
Browse files

Make user configurable

parent 5cc97e9a
No related branches found
No related tags found
No related merge requests found
---
- hosts: localhost
vars:
target_user: pi
pre_tasks:
# - name: Upgrade packages
# become: true
......
......@@ -5,9 +5,10 @@ Description=Jupyter Lab
Type=simple
PIDFile=/run/jupyter.pid
# Password: [empty string]
ExecStart=/usr/bin/python3 -m jupyterlab --ip="0.0.0.0" --notebook-dir=/home/pi/notebooks --no-browser --NotebookApp.password='sha1:9a2d316959ac:843b251c27024afb46174ce40ce0ebebcf29217b'
User=pi
Group=pi
ExecStart=/usr/bin/python3 -m jupyterlab --ip="0.0.0.0"
--notebook-dir=/home/{{ target_user }}/notebooks --no-browser --NotebookApp.password='sha1:9a2d316959ac:843b251c27024afb46174ce40ce0ebebcf29217b'
User={{ target_user }}
Group={{ target_user }}
Restart=always
RestartSec=10
......
......@@ -3,10 +3,10 @@
- name: Notebooks dir
file:
path: /home/pi/notebooks
path: "/home/{{ target_user }}/notebooks"
state: directory
owner: pi
group: pi
owner: "{{ target_user }}"
group: "{{ target_user }}"
# This should be optimized so that only one check / install is needed
# Still we should make sure that pip3 is actually installed before trying to use it
......@@ -27,7 +27,7 @@
- name: Install systemd service
become: true
copy:
template:
src: files/jupyter.service
dest: /etc/systemd/system/jupyter.service
mode: '0644'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment