This repository has been archived by the owner on Nov 3, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure salt state to use password and jupyter config
- Loading branch information
Showing
5 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{%- from 'conda/settings.sls' import install_prefix with context -%} | ||
{% set password = salt['pillar.get']('jupyter:password', 'jupyter') %} | ||
{%- set hash_password = salt["cmd.run"](install_prefix ~ "/bin/python -c 'from notebook.auth import passwd; print(passwd(\"" ~ password ~ "\"))'") -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
{%- set user = 'ubuntu' %} | ||
|
||
{% set user = salt['pillar.get']('cluster:username', 'ubuntu') %} | ||
|
||
{%- set home_dir = salt['user.info'](user).home %} | ||
{%- set jupyter_config_dir = home_dir ~ '/.jupyter/' %} | ||
{%- set jupyter_config_dir = '/' ~ home_dir ~ '/.jupyter/' %} | ||
|
||
{%- set port = 8888 %} | ||
{%- set notebooks_dir = '/home/ubuntu/notebooks' %} | ||
{%- set notebooks_dir = '/' ~ user ~ '/notebooks' %} |
13 changes: 13 additions & 0 deletions
13
dask_ec2/formulas/salt/jupyter/templates/jupyter_notebook_config_py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{%- from 'jupyter/notebook/settings.sls' import ip, port, plain_password, hash_password with context -%} | ||
|
||
c = get_config() | ||
|
||
# Kernel config | ||
c.IPKernelApp.pylab = "inline" # if you want plotting support always | ||
|
||
# Notebook config | ||
c.NotebookApp.ip = '0.0.0.0' | ||
c.NotebookApp.port = 8888 | ||
c.NotebookApp.port_retries = 0 | ||
c.NotebookApp.open_browser = False | ||
c.NotebookApp.password = u'{{ hash_password }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,7 @@ | |
supervisor-pkg: | ||
pkg.installed: | ||
- name: supervisor | ||
|
||
supervisor: | ||
service.running: | ||
- enable: True |