Merge pull request #37 from mscherer/fix_old_7420

Add hostname to generated user SSH key comment
This commit is contained in:
Brian Coca 2015-01-21 18:16:05 -05:00
commit d80e7438a6

View file

@ -160,7 +160,7 @@ options:
filename then it will be relative to the user's home directory. filename then it will be relative to the user's home directory.
ssh_key_comment: ssh_key_comment:
required: false required: false
default: ansible-generated default: ansible-generated on $HOSTNAME
version_added: "0.9" version_added: "0.9"
description: description:
- Optionally define the comment for the SSH key. - Optionally define the comment for the SSH key.
@ -199,6 +199,7 @@ import pwd
import grp import grp
import syslog import syslog
import platform import platform
import socket
try: try:
import spwd import spwd
@ -1462,7 +1463,7 @@ def main():
'bits': '2048', 'bits': '2048',
'type': 'rsa', 'type': 'rsa',
'passphrase': None, 'passphrase': None,
'comment': 'ansible-generated' 'comment': 'ansible-generated on %s' % socket.gethostname()
} }
module = AnsibleModule( module = AnsibleModule(
argument_spec = dict( argument_spec = dict(