lib/puppet/provider/tpm_ownership/trousers.rb
# Dump the owner password to a flat file in Puppet's `$vardir`
#
# @param [String] path where fact will be dumped
Dump the owner password to a flat file in Puppet's `$vardir`
Dump the owner password to a flat file in Puppet ' s ` $vardir `
def dump_owner_pass(vardir)
    pass_file = File.expand_path("#{vardir}/simp/tpm_ownership_owner_pass")
    if !File.directory?( File.dirname(pass_file) )
      FileUtils.mkdir_p( File.dirname(pass_file), :mode => 0700 )
      FileUtils.chown( 'root','root', File.dirname(pass_file) )
    end
    file = File.new( pass_file, 'w', 0660 )
    file.write( resource[:owner_pass] )
    file.close
    File.read(pass_file)
  end
def dump_owner_pass ( vardir ) pass_file = File . expand_path ( "#{vardir}/simp/tpm_ownership_owner_pass" ) if ! File . directory? ( File . dirname ( pass_file ) ) FileUtils . mkdir_p ( File . dirname ( pass_file ) , :mode => 0700 ) FileUtils . chown ( 'root' , 'root' , File . dirname ( pass_file ) ) end file = File . new ( pass_file , 'w' , 0660 ) file . write ( resource [ :owner_pass ] ) file . close File . read ( pass_file ) end
Dump the owner password to a flat file in Puppet's `$vardir`
Dump the owner password to a flat file in Puppet ' s ` $vardir `
# Check to make sure the SIMP directory in vardir exists, or create it # Dump the password to pass_file
vardir
path where fact will be dumped
path where fact will be dumped