From 11dbe27afb96c5b54b9f4f0a1c8b21194f59dc7b Mon Sep 17 00:00:00 2001 From: Jonas Bjurel Date: Sat, 3 Oct 2015 16:54:43 +0200 Subject: Moving tag arno.2015.1.0 from genesis to fuel/stable/arno Change-Id: I8bb3e28a814e04ad15e8a4b24b40bd7685600f46 Signed-off-by: Jonas Bjurel --- .../lib/puppet/parser/functions/extras_to_hosts.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 fuel/build/f_l23network/puppet/modules/l23network/lib/puppet/parser/functions/extras_to_hosts.rb (limited to 'fuel/build/f_l23network/puppet/modules/l23network/lib/puppet/parser/functions/extras_to_hosts.rb') diff --git a/fuel/build/f_l23network/puppet/modules/l23network/lib/puppet/parser/functions/extras_to_hosts.rb b/fuel/build/f_l23network/puppet/modules/l23network/lib/puppet/parser/functions/extras_to_hosts.rb new file mode 100644 index 000000000..33bfad8fd --- /dev/null +++ b/fuel/build/f_l23network/puppet/modules/l23network/lib/puppet/parser/functions/extras_to_hosts.rb @@ -0,0 +1,21 @@ +# +# array_or_string_to_array.rb +# + +module Puppet::Parser::Functions + newfunction(:extras_to_hosts, :type => :rvalue, :doc => <<-EOS + convert extras array passed from Astute into + hash for puppet `host` create_resources call + EOS + ) do |args| + hosts=Hash.new + extras=args[0] + extras.each do |extras| + hosts[extras['name']]={:ip=>extras['address'],:host_aliases=>[extras['fqdn']]} + notice("Generating extras host entry #{extras['name']} #{extras['address']} #{extras['fqdn']}") + end + return hosts + end +end + +# vim: set ts=2 sw=2 et : -- cgit 1.2.3-korg