Add support for Docker plugins (#4934)
* Add support for Docker plugins * support multiple Docker plugins using looped include * fix yamllint errorpull/4957/head
parent
c81b443d93
commit
324bc41097
|
@ -98,6 +98,7 @@ Stack](https://github.com/kubernetes-sigs/kubespray/blob/master/docs/dns-stack.m
|
|||
|
||||
* *docker_options* - Commonly used to set
|
||||
``--insecure-registry=myregistry.mydomain:5000``
|
||||
* *docker_plugins* - This list can be used to define [Docker plugins](https://docs.docker.com/engine/extend/) to install.
|
||||
* *http_proxy/https_proxy/no_proxy* - Proxy variables for deploying behind a
|
||||
proxy. Note that no_proxy defaults to all internal cluster IPs and hostnames
|
||||
that correspond to each node.
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
- name: Install Docker plugin
|
||||
command: docker plugin install --grant-all-permissions {{ docker_plugin | quote }}
|
||||
when: docker_plugin is defined
|
||||
register: docker_plugin_status
|
||||
failed_when:
|
||||
- docker_plugin_status.failed
|
||||
- '"already exists" not in docker_plugin_status.stderr'
|
|
@ -235,6 +235,12 @@
|
|||
resolvconf_mode == 'docker_dns' and
|
||||
installed_docker_version.stdout is version('1.12', '<')
|
||||
|
||||
# Install each plugin using a looped include to make error handling in the included task simpler.
|
||||
- include_tasks: docker_plugin.yml
|
||||
loop: "{{ docker_plugins }}"
|
||||
loop_control:
|
||||
loop_var: docker_plugin
|
||||
|
||||
- name: Set docker systemd config
|
||||
import_tasks: systemd.yml
|
||||
|
||||
|
|
|
@ -256,6 +256,10 @@ docker_options: >-
|
|||
--userland-proxy-path=/usr/libexec/docker/docker-proxy-current --signature-verification=false
|
||||
{%- endif -%}
|
||||
|
||||
## A list of plugins to install using 'docker plugin install --grant-all-permissions'
|
||||
## Empty by default so no plugins will be installed.
|
||||
docker_plugins: []
|
||||
|
||||
# Experimental kubeadm etcd deployment mode. Available only for new deployment
|
||||
etcd_kubeadm_enabled: false
|
||||
|
||||
|
|
Loading…
Reference in New Issue