Fixes#23095
Fixed issue preventing a caller from setting a docker
configuration file (e.g. docker.yml) by specifing the
config file path in the `DOCKER_CONFIG_FILE` environment
variable. Previously, the cli argument parser set a default value for
the `--config-file` argument which would prevent ever checking the
environment variable, regardless of whether or not the `--config-file`
argument even specified a valid file.
This commit adds a global `DEFAULT_DOCKER_CONFIG_FILE` variable, which
points to the current default `docker.yml` config in the
contrib/inventory directory. Now, when this script is called from the
command line, the config file passed with the cli `--config-file` arg
will be given the highest precedence; if it is absent, this script will
then check if the `DOCKER_CONFIG_FILE` env var is set, and load the
config file specified if possible. If neither the environment variable
or cli argument are specified, then the script will attempt to parse the
config file `docker.yml` in this script's directory (if present).
If either the `DOCKER_CONFIG_FILE` environment variable or the
`--config-file` argument are given but point to a nonexistant file, then
the script will print an error message and exit with an error code.
It is *not* an error condition if the fallback `docker.yml` does not
exist.
Read the Docs moved hosting to readthedocs.io instead of
readthedocs.org. Fix all links in the project.
For additional details, see:
https://blog.readthedocs.com/securing-subdomains/
> Starting today, Read the Docs will start hosting projects from
> subdomains on the domain readthedocs.io, instead of on
> readthedocs.org. This change addresses some security concerns around
> site cookies while hosting user generated data on the same domain as
> our dashboard.
* Use DOCKER_DEFAULT_IP when defined
* default localhost value overwrites DOCKER_TLS_HOSTNAME
* Backward compatibility, allow localhost as default docker_tls_hostname
* Update docker inventory to use APIClient
docker-py has been updated, and the `Client` class no longer
exists. We use the new `APIClient` class.
To provide graceful failure when docker-py is not installed,
we need to create a dummy `Client` class so that the inventory
script will get as far as displaying a useful error message
Before
```
$ contrib/inventory/docker.py --pretty
Traceback (most recent call last):
File "contrib/inventory/docker.py", line 418, in <module>
class AnsibleDockerClient(Client):
NameError: name 'Client' is not defined
```
After
```
$ contrib/inventory/docker.py --pretty
Failed to import docker-py. Try `pip install docker-py` - cannot import name Client
```
* docker inventory configuration file location
Allow docker.yml to live next to docker.py, as well as in the
current directory
renamed plugins to contrib (they are not really plugins)
rewrote README.md to reflect new usage
added new dir to setup.py so it gets copied with installation, in views
of making using inventory scripts easier in teh future