Merge pull request #1380 from jwfang/max-dns

docker_dns_servers_strict to control docker_dns_servers rtrim
This commit is contained in:
Brad Beam 2017-06-27 21:15:12 -05:00 committed by GitHub
commit 854cd1a517
3 changed files with 12 additions and 2 deletions

View file

@ -83,6 +83,9 @@ bin_dir: /usr/local/bin
## Please note that overlay2 is only supported on newer kernels ## Please note that overlay2 is only supported on newer kernels
#docker_storage_options: -s overlay2 #docker_storage_options: -s overlay2
# Uncomment this if you have more than 3 nameservers, then we'll only use the first 3.
#docker_dns_servers_strict: false
## Default packages to install within the cluster, f.e: ## Default packages to install within the cluster, f.e:
#kpm_packages: #kpm_packages:
# - name: kube-system/grafana # - name: kube-system/grafana

View file

@ -8,3 +8,5 @@ docker_repo_key_info:
docker_repo_info: docker_repo_info:
repos: repos:
docker_dns_servers_strict: yes

View file

@ -52,8 +52,13 @@
- name: check number of nameservers - name: check number of nameservers
fail: fail:
msg: "Too many nameservers" msg: "Too many nameservers. You can relax this check by set docker_dns_servers_strict=no and we will only use the first 3."
when: docker_dns_servers|length > 3 when: docker_dns_servers|length > 3 and docker_dns_servers_strict|bool
- name: rtrim number of nameservers to 3
set_fact:
docker_dns_servers: "{{ docker_dns_servers[0:3] }}"
when: docker_dns_servers|length > 3 and not docker_dns_servers_strict|bool
- name: check number of search domains - name: check number of search domains
fail: fail: