maint: let installer ensure /etc/sudoers.d directory exists

This commit is contained in:
Erik Sundell
2023-06-06 14:09:03 +02:00
parent 7974981f2d
commit d4c6da52e1
2 changed files with 1 additions and 2 deletions

View File

@@ -126,6 +126,7 @@ def ensure_usergroups():
user.ensure_group("jupyterhub-users")
logger.info("Granting passwordless sudo to JupyterHub admins...")
os.makedirs("/etc/sudoers.d/", exist_ok=True)
with open("/etc/sudoers.d/jupyterhub-admins", "w") as f:
# JupyterHub admins should have full passwordless sudo access
f.write("%jupyterhub-admins ALL = (ALL) NOPASSWD: ALL\n")