Merge pull request #301 from crawford/github
config: add support for multiple github users
This commit is contained in:
commit
44142ff8af
@ -21,6 +21,7 @@ type User struct {
|
|||||||
PasswordHash string `yaml:"passwd"`
|
PasswordHash string `yaml:"passwd"`
|
||||||
SSHAuthorizedKeys []string `yaml:"ssh_authorized_keys"`
|
SSHAuthorizedKeys []string `yaml:"ssh_authorized_keys"`
|
||||||
SSHImportGithubUser string `yaml:"coreos_ssh_import_github"`
|
SSHImportGithubUser string `yaml:"coreos_ssh_import_github"`
|
||||||
|
SSHImportGithubUsers []string `yaml:"coreos_ssh_import_github_users"`
|
||||||
SSHImportURL string `yaml:"coreos_ssh_import_url"`
|
SSHImportURL string `yaml:"coreos_ssh_import_url"`
|
||||||
GECOS string `yaml:"gecos"`
|
GECOS string `yaml:"gecos"`
|
||||||
Homedir string `yaml:"homedir"`
|
Homedir string `yaml:"homedir"`
|
||||||
|
@ -87,6 +87,12 @@ func Apply(cfg config.CloudConfig, env *Environment) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for _, u := range user.SSHImportGithubUsers {
|
||||||
|
log.Printf("Authorizing github user %s SSH keys for CoreOS user '%s'", u, user.Name)
|
||||||
|
if err := SSHImportGithubUser(user.Name, u); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
if user.SSHImportURL != "" {
|
if user.SSHImportURL != "" {
|
||||||
log.Printf("Authorizing SSH keys for CoreOS user '%s' from '%s'", user.Name, user.SSHImportURL)
|
log.Printf("Authorizing SSH keys for CoreOS user '%s' from '%s'", user.Name, user.SSHImportURL)
|
||||||
if err := SSHImportKeysFromURL(user.Name, user.SSHImportURL); err != nil {
|
if err := SSHImportKeysFromURL(user.Name, user.SSHImportURL); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user