sous-chefs / users

Development repository for the users cookbook
https://supermarket.chef.io/cookbooks/users
Apache License 2.0
138 stars 218 forks source link

allow pulling ssh_keys from a url #410

Closed majormoses closed 6 years ago

majormoses commented 6 years ago

411

Signed-off-by: Ben Abrams me@benabrams.it

Description

Often people expose ssh public keys via a url such as https://github.com/majormoses.keys which has a line separated list of keys. Basically this allows using static and dynamic ssh keys.

Check List

majormoses commented 6 years ago

I am not sure why the travis builds are failing but the kitchen tests pass fine for me locally:

$ kitchen verify default-ubuntu-1604
-----> Starting Kitchen (v1.16.0)
WARN: Unresolved specs during Gem::Specification.reset:
      artifactory (>= 0)
      octokit (~> 4.0)
      unf_ext (>= 0)
      winrm (~> 2.0)
      winrm-fs (~> 1.0)
      docker-api (~> 1.26)
      rainbow (~> 2)
      rspec (~> 3)
      diff-lcs (< 2.0, >= 1.2.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
-----> Verifying <default-ubuntu-1604>...
       Loaded tests from {:path=>"/home/babrams/projects/personal/chef-cookbooks/users/test/integration/default"} 

Profile: tests from {:path=>"/home/babrams/projects/personal/chef-cookbooks/users/test/integration/default"}
Version: (not specified)
Target:  ssh://vagrant@127.0.0.1:2222

  User test_user
     ✔  should exist
     ✔  uid should eq 9001
     ✔  groups should eq ["test_user", "testgroup", "nfsgroup"]
     ✔  shell should eq "/bin/bash"
  Group testgroup
     ✔  should exist
     ✔  gid should eq 3000
  Group nfsgroup
     ✔  should exist
     ✔  gid should eq 4000
  User test_user_keys_from_url
     ✔  should exist
     ✔  uid should eq 9002
     ✔  groups should eq ["test_user_keys_from_url", "testgroup", "nfsgroup"]
     ✔  shell should eq "/bin/bash"
  File /home/test_user_keys_from_url/.ssh/authorized_keys
     ✔  content should include "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC4j6wHVxbs1FQXxV4DaG6RyXMgHfxTSB0tb2uA2Z8kNy9mwZ14zvT9kUCyniXw...SpjyZqQI0tNCBUd8kE0ZR3Zn7OxXUvcanh5cgYRHiSeK10TKSd7BkzNUponUZTymZmHyeYLBZ8U1i83VJpQxQGOWbItJdD6MQ=="
     ✔  content should include "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCy3cbPekJYHAIa8J1fOr2iIqpx/7pl4giJYAG7HCfsunRRUq3dY1KhVw1BlmMG...lvkgzT2h4Ie6lyRgNv5QnUyAnW43O5FdBnPk/XZ3LA462VU3uOfr0AQtEJzPccpFC6OCFYWdGwZQA/r1EZQES0yRfJLpx+uZQ=="

Test Summary: 14 successful, 0 failures, 0 skipped
       Finished verifying <default-ubuntu-1604> (0m0.76s).
-----> Kitchen is finished. (0m41.60s)
majormoses commented 6 years ago

maybe the tests failing last night were caused by this? https://www.traviscistatus.com/incidents/4vdl52d28hz3

tas50 commented 6 years ago

Nice addition. Thanks