From 4c6174f14719f94ac3f928c7687c13dd957a0198 Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Mon, 18 Nov 2013 15:39:08 +0100 Subject: [PATCH] env_var hash validation, version: 0.1.1 --- Modulefile | 2 +- manifests/slave.pp | 4 +++- templates/slave.erb | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Modulefile b/Modulefile index 7ed5160..6e5b173 100644 --- a/Modulefile +++ b/Modulefile @@ -1,5 +1,5 @@ name 'puppet-mesos' -version '0.1.0' +version '0.1.1' source 'http://github.com/deric/puppet-mesos' author 'Tomas Barton' license 'Apache License, Version 2.0' diff --git a/manifests/slave.pp b/manifests/slave.pp index e974b28..cb75789 100644 --- a/manifests/slave.pp +++ b/manifests/slave.pp @@ -32,9 +32,11 @@ $owner = $mesos::owner, $group = $mesos::group, $conf_dir = $mesos::conf_dir, - $env_var = undef, + $env_var = {}, ) inherits mesos { + validate_hash($env_var) + file { "${conf_dir}/slave.conf": ensure => 'present', content => template('mesos/slave.erb'), diff --git a/templates/slave.erb b/templates/slave.erb index 2c35d57..b5591c4 100644 --- a/templates/slave.erb +++ b/templates/slave.erb @@ -30,7 +30,7 @@ CHECKPOINT=<%= @checkpoint %> # slave environment variables <% if @env_var %> - <% @env_var.each do |key,val| %> +<% @env_var.each do |key,val| %> export <%= key %>="<%= val %>" - <% end %> +<% end %> <% end %> \ No newline at end of file