Default variables

docker-gen installation

docker_gen_repo

Address of the docker-gen GitHub repository.

docker_gen_repo: 'https://github.com/jwilder/docker-gen'
docker_gen_os_arch

Operating System and Architecture of the docker-gen tarball to install.

docker_gen_os_arch: 'linux-amd64'
docker_gen_version

Version of docker-gen to install.

docker_gen_version: '0.4.1'
docker_gen_release

Templated URL of the docker-gen release which will be downloaded from GitHub.

docker_gen_release: '{{ docker_gen_repo }}/releases/download/{{ docker_gen_version }}/docker-gen-{{ docker_gen_os_arch }}-{{ docker_gen_version }}.tar.gz'
docker_gen_src

Location of docker-gen sources on remote host where source tarball will be stored.

docker_gen_src: '{{ (ansible_local.root.src
                     if (ansible_local|d() and ansible_local.root|d() and
                         ansible_local.root.src|d())
                     else "/usr/local/src") + "/docker-gen" }}'
docker_gen_lib

Location where docker-gen binary will be installed (not in the $PATH since this binary won’t be used by the user, but as a service).

docker_gen_lib: '{{ (ansible_local.root.lib
                     if (ansible_local|d() and ansible_local.root|d() and
                         ansible_local.root.lib|d())
                     else "/usr/local/lib") + "/docker-gen" }}'
docker_gen_templates

Location where docker-gen templates will be installed.

docker_gen_templates: '{{ docker_gen_lib + "/templates" }}'
docker_gen_config

Custom configuration in the YAML text block format, added at the end of the generated /etc/docker-gen.conf configuration file. Should be in the format:

docker_gen_config: |
  [[config]]
  key = "value"
  option = true
docker_gen_config: ''

Remote Docker support

docker_gen_remote

By default docker-gen expects Docker to be installed and available locally. With this option set to True you can enable support for remote Docker TCP connection over TLS.

docker_gen_remote: False
docker_gen_remote_host

Specify FQDN hostname or IP address of the remote Docker host.

docker_gen_remote_host: ''
docker_gen_remote_port

Specify the TCP port used to connect to Docker using TLS.

docker_gen_remote_port: '2375'
docker_gen_remote_endpoint

This is the -endpoint option passed to the docker-gen binary when the remote support is enabled.

docker_gen_remote_endpoint: 'tcp://{{ docker_gen_remote_host }}:{{ docker_gen_remote_port }}'

nginx upstream support

docker_gen_nginx

Enable support for generating nginx upstream definitions. docker-gen will create entry for each container which has NGINX_UPSTREAM variable set in its environment, for example:

docker run -e NGINX_UPSTREAM=docker_upstream -d ...
docker_gen_nginx: True
docker_gen_nginx_template

Path to the template file used by docker-gen to generate nginx configuration.

docker_gen_nginx_template: '{{ docker_gen_templates + "/nginx-upstreams.conf.tmpl" }}'
docker_gen_nginx_dest

Path where docker-gen saves the generated nginx configuration.

docker_gen_nginx_dest: '/etc/nginx/conf.d/docker-gen-upstreams.conf'
docker_gen_nginx_options

Additional options added to the nginx configuration section in docker-gen config file, in YAML text block format.

docker_gen_nginx_options: |
  onlyexposed = true
  watch = true
docker_gen_nginx_notify

Notify command used by docker-gen to reload nginx, depending on the init system used.

docker_gen_nginx_notify: '{{ docker_gen_nginx_notify_map[(ansible_local.init
                             if (ansible_local|d() and ansible_local.init|d())
                                 else "systemd")] }}'
docker_gen_nginx_notify_map

Dictionary map fo commands used to reload nginx by docker-gen.

docker_gen_nginx_notify_map:
  systemd:  'nginx -t && systemctl reload nginx'
  sysvinit: 'nginx -t && service nginx reload'
  upstart:  'nginx -t && service nginx reload'

PKI and certificates

docker_gen_pki

Enable or disable support for PKI certificates managed by debops.pki.

docker_gen_pki: '{{ (True
                     if (ansible_local|d() and ansible_local.pki|d() and
                         ansible_local.pki.enabled|d() | bool)
                     else False) | bool }}'
docker_gen_pki_path

Directory where PKI files are located on the remote host.

docker_gen_pki_path: '{{ ansible_local.pki.base_path
                         if (ansible_local|d() and ansible_local.pki|d() and
                             ansible_local.pki.base_path|d())
                         else "/etc/pki" }}'
docker_gen_pki_realm

Name of the PKI realm used by docker-gen.

docker_gen_pki_realm: '{{ ansible_local.pki.realm
                          if (ansible_local|d() and ansible_local.pki|d() and
                              ansible_local.pki.realm|d())
                          else "system" }}'
docker_gen_pki_ca

Name of the Root CA certificate file used by docker-gen.

docker_gen_pki_ca: 'CA.crt'
docker_gen_pki_crt

Name of the host certificate used by docker.

docker_gen_pki_crt: 'default.crt'
docker_gen_pki_key

Name of the private key file used by docker-gen.

docker_gen_pki_key: 'default.key'