Class: Tapjoy::LDAP::Key::Install

Inherits:
Object
  • Object
show all
Defined in:
lib/tapjoy/ldap/key/install.rb

Overview

Install key on localhost

Instance Method Summary collapse

Instance Method Details

#installObject



6
7
8
9
10
11
12
13
14
# File 'lib/tapjoy/ldap/key/install.rb', line 6

def install
  Tapjoy::LDAP::Key.get_keys_from_ldap.each do |user, values|
    directory = directory(user)
    FileUtils.mkdir_p(directory) unless File.exists?directory
    authorized_keys_file = "#{directory}/authorized_keys"
    keys = load_keys_from_file(authorized_keys_file)
    insert_keys(authorized_keys_file, keys, values)
  end
end