Sha256: 58ea5ea7b5887c41d8bb84fc796dbadd5e6dbbf48a4860b315af3f945516fb7f

Contents?: true

Size: 836 Bytes

Versions: 6

Compression:

Stored size: 836 Bytes

Contents

username = ENV['SUDO_USER'].strip

file "/home/#{username}/.ssh/id_rsa" do
  content CI_CONFIG['id_rsa_for_github_access']
  mode 0600
  only_if { CI_CONFIG['id_rsa_for_github_access'] }
  owner username
end

execute "add github to known hosts if necessary" do
  github_string = 'github.com,207.97.227.239 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' 
  command "echo '#{github_string}' >> /home/#{username}/.ssh/known_hosts"
  not_if "grep '#{github_string}' /home/#{username}/.ssh/known_hosts"
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lobot-0.9.7 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/id_rsa.rb
lobot-0.9.6 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/id_rsa.rb
lobot-0.9.5 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/id_rsa.rb
lobot-0.9.4 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/id_rsa.rb
lobot-0.9.2 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/id_rsa.rb
lobot-0.9.0 lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/id_rsa.rb