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

Version Path
dtk-node-agent-0.12.2 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb
dtk-node-agent-0.12.1 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb
dtk-node-agent-0.12.0 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb
dtk-node-agent-0.11.4 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb
dtk-node-agent-0.11.3 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb
dtk-node-agent-0.11.2 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb
dtk-node-agent-0.11.1 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb
dtk-node-agent-0.11.0 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb
dtk-node-agent-0.10.7 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb
dtk-node-agent-0.10.6 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb
dtk-node-agent-0.10.5 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb
dtk-node-agent-0.10.4 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb
dtk-node-agent-0.10.3 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb
dtk-node-agent-0.10.2 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb
dtk-node-agent-0.10.1 puppet_additions/modules/dtk/lib/puppet/provider/dtk_export_variable/default.rb