'Some of the functionality this ansible module implements are only
available in newer versions of docker.  Ensure that the capability
is available here.
If fail is set to False then return True or False depending on whether
we have the capability.  Otherwise, simply fail and exit the module if
we lack the capability.'

def ensure_capability(self, capability, fail=True):

    if (not self._capabilities):
        self._check_capabilities()
    if (capability in self._capabilities):
        return True
    if (not fail):
        return False
    api_version = self.client.version()['ApiVersion']
    self.module.fail_json(msg=('Specifying    the    `%s`    parameter    requires    docker-py:    %s,    docker    server    apiversion    %s;    found    docker-py:    %s,    server:    %s' % (capability, '.'.join(map(str, self._cap_ver_req[capability][0])), self._cap_ver_req[capability][1], '.'.join(map(str, self.docker_py_versioninfo)), api_version)))
