dokku / ansible-dokku

Ansible modules for installing and configuring Dokku
MIT License
176 stars 44 forks source link

Update of dokku user ssh key of user is not applied via ansible #83

Closed ltalirz closed 4 years ago

ltalirz commented 4 years ago

dokku users specified in the dokku_users variable are currently processed only if a user of the same name does not yet exist: https://github.com/dokku/ansible-dokku/blob/7cf7fc993bef6404766a360307487f4d48d85a85/tasks/ssh-keys.yml#L17

In particular, this means that updating the ssh_key field of a user won't have any effect after the user has first been created.

I see that the output of sshcommand list dokku actually contains an SHA256 hash of the key as well:

SHA256:tjAdZkgsPV+D7rEEGYiCAQnC8ya/L2zwsZ5qJt11QrQ NAME="ltalirz" SSHCOMMAND_ALLOWED_KEYS="no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port-forwarding"

@josegonzalez I'd be happy to add a PR that includes a check for the SHA256 as well, if you could tell me how to best compute it on the fly via ansible

josegonzalez commented 4 years ago

Maybe this? https://github.com/dokku/sshcommand/blob/master/sshcommand#L149