Method: Bard::Provision::AuthorizedKeys#call

Defined in:
lib/bard/provision/authorizedkeys.rb

#callObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/bard/provision/authorizedkeys.rb', line 4

def call
  print "Authorized Keys:"

  KEYS.each do |search_text, full_key|
    file = "~/.ssh/authorized_keys"
    provision_server.run! <<~SH, home: true
      if ! grep -F -q "#{search_text}" #{file}; then
        echo "#{full_key}" >> #{file}
      fi
    SH
  end

  puts ""
end