def password_present(name, password):
 ret = {'name': name, 'result': True, 'changes': {'old': 'unknown', 'new': '********'}, 'comment': 'Host password was updated.'}
 esxi_cmd = 'esxi.cmd'
 if __opts__['test']:
  ret['result'] = None
  ret['comment'] = 'Host password will change.'
  return ret
 else:
  try:
   __salt__[esxi_cmd]('update_host_password', new_password=password)
  except CommandExecutionError as err:
   ret['result'] = False
   ret['comment'] = 'Error: {0}'.format(err)
   return ret
 return ret

def password_present ( name , password ) : ret = { 'name' : name , 'result' : True , 'changes' : { 'old' : 'unknown' , 'new' : '********' } , 'comment' : 'Host password was updated.' } esxi_cmd = 'esxi.cmd' if __opts__ [ 'test' ] : ret [ 'result' ] = None ret [ 'comment' ] = 'Host password will change.' return ret else : try : __salt__ [ esxi_cmd ] ( 'update_host_password' , new_password = password ) except CommandExecutionError as err : ret [ 'result' ] = False ret [ 'comment' ] = 'Error: {0}' . format ( err ) return ret return ret
ensures the given password is set on the esxi host .