Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

re-organize bach_web json page #1282

Merged
merged 2 commits into from
Sep 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions cookbooks/bcpc-hadoop/attributes/hbase.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,15 @@
default['bcpc']['hadoop']['hbase']['env']['regionserver_java_agents'] = []

# hbase bach web attributes
default['bcpc']['bach_web']['service_ports']['hbase_master_ui'] = {
'desc' => 'HBase Master UI port',
'port' => node['bcpc']['hadoop']['hbase_master']['http']['port']
}
default['bcpc']['bach_web']['service_ports']['hbase_rs_ui'] = {
'desc' => 'HBase RS UI port',
'port' => node['bcpc']['hadoop']['hbase_rs']['http']['port']
default['bcpc']['bach_web']['services']['hbase'] = {
'desc' => 'HBase Master',
'port' => node['bcpc']['hadoop']['hbase_master']['http']['port'],
'conn_lib' => {
'blacklist' => [
'hadoop.security.group.mapping.ldap.bind.password.file',
'hbase.master.hostname'
],
'whitelist' => nil
}
}

default['bcpc']['bach_web']['conn_lib']['hbase_conn_lib_blacklist'] = []
default['bcpc']['bach_web']['files']['hbase_conn_lib_blacklist'] = {
'desc' => 'HBase conn lib blacklist file',
'path' => 'files/hbase/blacklist.conf'
}
22 changes: 9 additions & 13 deletions cookbooks/bcpc-hadoop/attributes/hdfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,13 @@
end

# hdfs bach web attributes
default['bcpc']['bach_web']['service_ports']['namenode_ui'] = {
'desc' => 'HDFS Namenode UI port',
'port' => node['bcpc']['hadoop']['namenode']['http']['port']
}
default['bcpc']['bach_web']['service_ports']['datanode_ui'] = {
'desc' => 'HDFS Datanode UI port',
'port' => node['bcpc']['hadoop']['datanode']['http']['port']
}

default['bcpc']['bach_web']['conn_lib']['hdfs_conn_lib_blacklist'] = []
default['bcpc']['bach_web']['files']['hdfs_conn_lib_blacklist'] = {
'desc' => 'HDFS conn lib blacklist file',
'path' => 'files/hdfs/blacklist.conf'
default['bcpc']['bach_web']['services']['hdfs'] = {
'desc' => 'HDFS Namenode',
'port' => node['bcpc']['hadoop']['namenode']['http']['port'],
'conn_lib' => {
'blacklist' => [
'hadoop.security.group.mapping.ldap.bind.password.file'
],
'whitelist' => nil
}
}
15 changes: 0 additions & 15 deletions cookbooks/bcpc-hadoop/recipes/hbase_web.rb

This file was deleted.

15 changes: 0 additions & 15 deletions cookbooks/bcpc-hadoop/recipes/hdfs_web.rb

This file was deleted.

10 changes: 10 additions & 0 deletions cookbooks/bcpc/attributes/apache2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,14 @@

# extra files to be exposed
bach_web['files_url'] = 'files'

# links to services (an hash of hashes with structure:
# <name>=>{'desc':<desc> and 'url':<url>} to be listed)
bach_web['links'] = {}
# files to be served from nodes
# <name>=>{'desc':<desc> and 'path':<file>} to be listed)
# note: file needs to be under the document_root/files directory
bach_web['files'] = {}
# <name>=>{'desc':<desc> and 'port':<port>} to be listed)
bach_web['services'] = {}
end
4 changes: 2 additions & 2 deletions cookbooks/bcpc/recipes/apache2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@
mode 0o0644
variables(
'cluster_name' => node.chef_environment,
'service_ports' => node['bcpc']['bach_web']['service_ports'],
'services' => node['bcpc']['bach_web']['services'],
'links' => node['bcpc']['bach_web']['links'],
'files' => node['bcpc']['bach_web']['files']
)
notifies :restart, 'service[apache2]', :delayed
end

# A json files that expose the configs for easier consumption programatically.
# NOTE: node['bcpc']['bach_web'] should NOT contain anything sensitive or confidential
# NOTE: node['bcpc']['bach_web'] should NOT contain anything sensitive or confidential
# otherwise a dedicated hash should be used
file "#{node['bcpc']['bach_web']['document_root']}/#{node['bcpc']['bach_web']['json_file']}" do
content Chef::JSONCompat.to_json_pretty(node['bcpc']['bach_web'].to_hash)
Expand Down
4 changes: 2 additions & 2 deletions cookbooks/bcpc/templates/default/bach.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<body>
<h2>Cluster: <%= @cluster_name %></h2>

<% if @service_ports.length > 0 -%>
<% if @services.length > 0 -%>
<h3>Ports</h3>
<% (@service_ports || {}).each do |service, values| %>
<% (@services || {}).each do |service, values| %>
<div class="block">
<label><%= values['desc'] %>: <%= values['port'] %></label>
</div>
Expand Down