def METHOD_NAME(
        module, conda, installed, name, version, installed_version):
    """
    Install a package at a specific version, or install a missing package at
    the latest version if no version is specified.
    """
    if installed and (version is None or installed_version == version):
        module.exit_json(changed=False, name=name, version=version)
    if module.check_mode:
        if not installed or (installed and installed_version != version):
            module.exit_json(changed=True)
    if version:
        install_str = name + '=' + version
    else:
        install_str = name
    command = [
        conda,
        'install',
        '--yes',
        install_str
    ]
    command = _add_channels_to_command(command, module.params['channels'])
    command = _add_extras_to_command(command, module.params['extra_args'])
    rc, stdout, stderr = module.run_command(command)
    if rc != 0:
        module.fail_json(msg='failed to install package ' + name)
    module.exit_json(
        changed=True, name=name, version=version, stdout=stdout, stderr=stderr)