   , (err, uploaded) ->
     next err, if uploaded then ctx.OK else ctx.PASS
 
+###
+Host
+----
+
+Setup the Ganglia hosts. Categories are "HDPNameNode", "HDPResourceManager", 
+"HDPSlaves" and "HDPHBaseMaster".
+###
 module.exports.push name: 'Ganglia Monitor # Host', timeout: -1, callback: (ctx, next) ->
   cmds = []
-  # If HBase is installed, on the HBase Master
-  # this seems to be an error, we moved it to the ganglia master collector
-  # if ctx.has_any_modules 'phyla/hdp/hbase_master'
-  #  cmds.push cmd: "/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPHBaseMaster -m"
   # On the NameNode and SecondaryNameNode servers, to configure the gmond emitters
   if ctx.has_any_modules 'phyla/hdp/hdfs_nn', 'phyla/hdp/hdfs_snn'
     cmds.push cmd: "/usr/libexec/hdp/ganglia/setupGanglia.sh -c HDPNameNode"

  ctx.write writes, (err, written) ->
    next err, if written then ctx.OK else ctx.PASS

module.exports.push name: 'Ganglia Monitor # Hadoop', callback: (ctx, next) ->
  collector = ctx.host_with_module 'phyla/hdp/ganglia_collector'
  ctx.write

  ctx.execute cmds, (err, executed) ->
    next err, if executed then ctx.OK else ctx.PASS

###
Configuration
-------------

Update the files generated in the "host" action with the host of the Ganglia Collector.
###
module.exports.push name: 'Ganglia Monitor # Configuration', timeout: -1, callback: (ctx, next) ->
  collector = ctx.host_with_module 'phyla/hdp/ganglia_collector'
  writes = []
