camptocamp / puppet-accounts

11 stars 40 forks source link

ssh key comment doesn't get added to authorized keys #9

Closed claflico closed 9 years ago

claflico commented 9 years ago

Copied and pasted from the examples provided.

accounts::ssh_keys:
  foo:
    comment: foo@example.com
    type: ssh-rsa
    public: FOO-S-RSA-PUBLIC-KEY

accounts::users:
  foo:
    uid: 1000
    comment: Foo

  class { 'accounts':
    ssh_keys   => hiera_hash('accounts::ssh_keys', {}),
    users      => hiera_hash('accounts::users', {}),
    usergroups => hiera_hash('accounts::usergroups', {}),
  }
  accounts::account { 'foo': }

run puppet and the user gets created on the node but the ssh key comment doesn't get added and instead is name-on-name:

cat authorized_keys
# HEADER: This file was autogenerated at 2015-04-10 17:48:16 -0500
# HEADER: by puppet.  While it can still be managed manually, it
# HEADER: is definitely not recommended.
ssh-rsa FOO-S-RSA-PUBLIC-KEY foo-on-foo
flynet70 commented 9 years ago

I confirm

mcanevet commented 9 years ago

Well, I should probably remove this from the doc. You should use this if you want to specify the key's comment:

---
accounts::ssh_keys:
  foo@example.com:
    type: ssh-rsa
    public: XXXX
accounts::users:
  foo:
    uid: 1000
    comment: Foo

Then:

accounts::accounts { 'foo':
  authorized_keys => [ 'foo@example.com', ],
}