Ottomata has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/193105

Change subject: Add hash to set extra properties on yarn-site.xml file
......................................................................

Add hash to set extra properties on yarn-site.xml file

I want to use this to set scheduler properties

Change-Id: Ic40fb14599326c834ea6b5c498bed2d730c759a4
---
M manifests/hadoop.pp
M manifests/hadoop/defaults.pp
M templates/hadoop/yarn-site.xml.erb
3 files changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet/cdh 
refs/changes/05/193105/1

diff --git a/manifests/hadoop.pp b/manifests/hadoop.pp
index ae148cf..d859a7f 100644
--- a/manifests/hadoop.pp
+++ b/manifests/hadoop.pp
@@ -90,6 +90,8 @@
 #   $fair_scheduler_template                  - The fair-scheduler.xml queue 
configuration template.
 #                                               If you set this to false or 
undef, FairScheduler will
 #                                               be disabled.  Default: 
cdh/hadoop/fair-scheduler.xml.erb
+#   $yarn_site_extra_properties               - Hash of extra property names 
to values that will be
+#                                               be rendered in 
yarn-site.xml.erb.  Default: undef
 #
 class cdh::hadoop(
     $namenode_hosts,
@@ -140,6 +142,7 @@
     $gelf_logging_host                           = 
$::cdh::hadoop::defaults::gelf_logging_host,
     $gelf_logging_port                           = 
$::cdh::hadoop::defaults::gelf_logging_port,
     $fair_scheduler_template                     = 
$::cdh::hadoop::defaults::fair_scheduler_template,
+    $yarn_site_extra_properties                  = 
$::cdh::hadoop::defaults::yarn_site_extra_properties,
 ) inherits cdh::hadoop::defaults
 {
     # If $dfs_name_dir is a list, this will be the
diff --git a/manifests/hadoop/defaults.pp b/manifests/hadoop/defaults.pp
index 4c3cae1..d735569 100644
--- a/manifests/hadoop/defaults.pp
+++ b/manifests/hadoop/defaults.pp
@@ -44,6 +44,7 @@
     $yarn_scheduler_maximum_allocation_mb     = undef
 
     $fair_scheduler_template                  = 
'cdh/hadoop/fair-scheduler.xml.erb'
+    $yarn_site_extra_properties               = undef
 
     $hadoop_heapsize                          = undef
     $hadoop_namenode_opts                     = undef
diff --git a/templates/hadoop/yarn-site.xml.erb 
b/templates/hadoop/yarn-site.xml.erb
index 9a66b92..3392a54 100644
--- a/templates/hadoop/yarn-site.xml.erb
+++ b/templates/hadoop/yarn-site.xml.erb
@@ -142,4 +142,14 @@
         $HADOOP_YARN_HOME/*,$HADOOP_YARN_HOME/lib/*
      </value>
   </property>
+
+<% if @yarn_site_extra_properties -%>
+<% @yarn_site_extra_properties.each do |key, value| -%>
+  <property>
+      <name><%= key %></name>
+      <value><%= value %></value>
+  </property>
+
+<% end -%>
+<% end -%>
 </configuration>

-- 
To view, visit https://gerrit.wikimedia.org/r/193105
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic40fb14599326c834ea6b5c498bed2d730c759a4
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet/cdh
Gerrit-Branch: master
Gerrit-Owner: Ottomata <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to