File tree Expand file tree Collapse file tree 3 files changed +22
-19
lines changed Expand file tree Collapse file tree 3 files changed +22
-19
lines changed Original file line number Diff line number Diff line change 44
44
default [ :ipynb ] [ :NotebookApp ] [ :pylab ] = 'inline'
45
45
46
46
# IP to host on, defaults to all interfaces
47
- default [ :ipynb ] [ :NotebookApp ] [ :ip ] = '* '
47
+ default [ :ipynb ] [ :NotebookApp ] [ :ip ] = '127.0.0.1 '
48
48
49
49
# Port to host on
50
50
default [ :ipynb ] [ :NotebookApp ] [ :port ] = 8888
Original file line number Diff line number Diff line change 21
21
action :create do
22
22
Chef ::Log . info ( "Creating profile \" #{ new_resource . name } \" for #{ new_resource . owner } " )
23
23
Chef ::Log . info ( "IPython path is at #{ new_resource . ipython_path } " )
24
- create_profile ( new_resource . ipython_path , new_resource . owner , new_resource . name )
24
+ Chef ::Log . info ( "IPython settings are at #{ new_resource . ipython_settings_dir } " )
25
+ create_profile ( new_resource . ipython_path , new_resource . owner ,
26
+ new_resource . name , new_resource . ipython_settings_dir )
25
27
end
26
28
27
- def create_profile ( ipython_path , owner , name )
29
+ def create_profile ( ipython_path , owner , name , ipython_settings_dir )
28
30
bash "create_profile" do
29
31
user owner
30
32
group owner
31
33
code <<-EOH
32
- #{ ipython_path } profile create --profile=#{ name } --ipython-dir #{ node [ :ipynb ] [ : ipython_settings_dir] }
34
+ #{ ipython_path } profile create --profile=#{ name } --ipython-dir #{ ipython_settings_dir }
33
35
EOH
34
36
environment
35
37
end
Original file line number Diff line number Diff line change 35
35
action :create
36
36
owner node [ :ipynb ] [ :linux_user ]
37
37
ipython_path "#{ node [ :ipynb ] [ :virtenv ] } /bin/ipython"
38
+ ipython_settings_dir node [ :ipynb ] [ :ipython_settings_dir ]
38
39
end
39
40
40
41
ipynb_profile node [ :ipynb ] [ :profile_name ] do
41
42
action :create
42
43
owner node [ :ipynb ] [ :linux_user ]
43
44
ipython_path "#{ node [ :ipynb ] [ :virtenv ] } /bin/ipython"
45
+ ipython_settings_dir node [ :ipynb ] [ :ipython_settings_dir ]
44
46
end
45
47
46
48
ipynb_mathjax "MathJax!" do
@@ -108,7 +110,7 @@ def cert_up(cert_file, cert_file_text)
108
110
end
109
111
end
110
112
111
- # include_recipe "firewall"
113
+ include_recipe "firewall"
112
114
113
115
# Setup nginx forwarding if enabled
114
116
if node [ :ipynb ] [ :proxy ] [ :enable ]
@@ -160,22 +162,21 @@ def cert_up(cert_file, cert_file_text)
160
162
enable true
161
163
end
162
164
163
- # firewall_rule "http " do
164
- # port 80
165
- # action :allow
166
- # end
165
+ firewall_rule "ssh " do
166
+ port 22
167
+ action :allow
168
+ end
167
169
168
- #firewall_rule "https" do
169
- # port 443
170
- # action :allow
171
- #end
170
+ firewall_rule "https" do
171
+ ports [ 80 , 443 ]
172
+ protocol :tcp
173
+ action :allow
174
+ end
172
175
173
176
else
174
- # firewall_rule node[:ipynb][:service_name] do
175
- # port node[:ipynb][:NotebookApp][:port]
176
- # action :allow
177
- # end
177
+ firewall_rule node [ :ipynb ] [ :service_name ] do
178
+ port node [ :ipynb ] [ :NotebookApp ] [ :port ]
179
+ action :allow
180
+ end
178
181
end
179
182
180
-
181
-
You can’t perform that action at this time.
0 commit comments