Tweaks to authorized_key module, questions about fine points.

There are minor tweaks to the authorized_key module. Pull request should come soon. Main change is mcodd suggested getting rid of “with” clauses so it runs under Python 2.4. Thanks, Matt!

There are a couple minor behaviors I’d like feedback on.

  1. Should the module put “#Edited by Ansible” or something like that atop the file? Currently it does, mostly from my latent Puppet habbits.
  2. Should the module add that comment even if a key state=absent? Currently it does.
    On one hand, idempotency would suggest don’t add the comment, or only add it if there’s a change. OTOH, the fact that a configuration management system may alter it is important for human editors to know on machines that have to support human logins.

Opinions?

There are a couple minor behaviors I’d like feedback on.

  1. Should the module put “#Edited by Ansible” or something like that atop the file? Currently it does, mostly from my latent Puppet habbits.

That’s something you typically put in files that will be overwritten by the config tool if modified, and in this case, you are treating SSH keys as resources.

It doesn’t make sense in this case as you can still hand edit the file.

  1. Should the module add that comment even if a key state=absent? Currently it does.

If the module does not have to edit the file to make any changes, it must not edit or rewrite the file.

I’ll make an issue for these, to be followed up by a pull request later today.