diff --git a/lib/ansible/modules/system/user.py b/lib/ansible/modules/system/user.py index aaeee5683d3..d5602f9cb60 100644 --- a/lib/ansible/modules/system/user.py +++ b/lib/ansible/modules/system/user.py @@ -159,7 +159,7 @@ options: - Optionally specify the SSH key filename. ssh_key_comment: required: false - default: ansible-generated + default: ansible-generated on $HOSTNAME version_added: "0.9" description: - Optionally define the comment for the SSH key. @@ -198,6 +198,7 @@ import pwd import grp import syslog import platform +import socket try: import spwd @@ -1463,7 +1464,7 @@ def main(): 'bits': '2048', 'type': 'rsa', 'passphrase': None, - 'comment': 'ansible-generated' + 'comment': 'ansible-generated on %s' % socket.gethostname() } module = AnsibleModule( argument_spec = dict(