Sha256: 386e3976cbb38503c9600a788c9d21b1a8f1ae004174079763409934425cb4b5
Contents?: true
Size: 660 Bytes
Versions: 15
Compression:
Stored size: 660 Bytes
Contents
require 'fileutils' Puppet::Type.type(:dtk_export_variable).provide(:default) do desc "dtk export variable" def create name = resource[:name] content = resource[:content] if name =~ /(^.+)::(.+$)/ component = $1 attribute = $2 if content = (content == '***' ? scope.lookupvar(name) : content) p = Thread.current[:exported_variables] ||= Hash.new (p[component] ||= Hash.new)[attribute] = content File.open('/tmp/dtk_exported_variables', 'w') { |f| f.write(Marshal.dump(p)) } end end end def destroy FileUtils.rm_rf("/tmp/dtk_exported_variables") end def exists? end end
Version data entries
15 entries across 15 versions & 1 rubygems