Merge pull request #3524 from mscherer/add_path_user

Change home and ssh_key_file to 'path' in user module
This commit is contained in:
Toshio Kuratomi 2016-04-23 08:18:26 -07:00
commit b6bca63205

View file

@ -279,12 +279,9 @@ class User(object):
self.ssh_comment = module.params['ssh_key_comment'] self.ssh_comment = module.params['ssh_key_comment']
self.ssh_passphrase = module.params['ssh_key_passphrase'] self.ssh_passphrase = module.params['ssh_key_passphrase']
self.update_password = module.params['update_password'] self.update_password = module.params['update_password']
self.home = None self.home = module.params['home']
self.expires = None self.expires = None
if module.params['home'] is not None:
self.home = os.path.expanduser(module.params['home'])
if module.params['expires']: if module.params['expires']:
try: try:
self.expires = time.gmtime(module.params['expires']) self.expires = time.gmtime(module.params['expires'])
@ -2029,7 +2026,7 @@ def main():
group=dict(default=None, type='str'), group=dict(default=None, type='str'),
groups=dict(default=None, type='str'), groups=dict(default=None, type='str'),
comment=dict(default=None, type='str'), comment=dict(default=None, type='str'),
home=dict(default=None, type='str'), home=dict(default=None, type='path'),
shell=dict(default=None, type='str'), shell=dict(default=None, type='str'),
password=dict(default=None, type='str', no_log=True), password=dict(default=None, type='str', no_log=True),
login_class=dict(default=None, type='str'), login_class=dict(default=None, type='str'),
@ -2049,7 +2046,7 @@ def main():
generate_ssh_key=dict(type='bool'), generate_ssh_key=dict(type='bool'),
ssh_key_bits=dict(default=ssh_defaults['bits'], type='str'), ssh_key_bits=dict(default=ssh_defaults['bits'], type='str'),
ssh_key_type=dict(default=ssh_defaults['type'], type='str'), ssh_key_type=dict(default=ssh_defaults['type'], type='str'),
ssh_key_file=dict(default=None, type='str'), ssh_key_file=dict(default=None, type='path'),
ssh_key_comment=dict(default=ssh_defaults['comment'], type='str'), ssh_key_comment=dict(default=ssh_defaults['comment'], type='str'),
ssh_key_passphrase=dict(default=None, type='str', no_log=True), ssh_key_passphrase=dict(default=None, type='str', no_log=True),
update_password=dict(default='always',choices=['always','on_create'],type='str'), update_password=dict(default='always',choices=['always','on_create'],type='str'),