Browse Source
Merge pull request #3135 from ishitatsuyuki/patch-1
Add bad hostname preflight check
pull/3138/merge
Rong Zhang
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
0 deletions
-
roles/kubernetes/preinstall/tasks/verify-settings.yml
|
|
@ -103,3 +103,9 @@ |
|
|
|
that: ansible_kernel.split('-')[0]|version_compare('4.8', '>=') |
|
|
|
when: kube_network_plugin == 'cilium' |
|
|
|
ignore_errors: "{{ ignore_assert_errors }}" |
|
|
|
|
|
|
|
- name: Stop if bad hostname |
|
|
|
assert: |
|
|
|
that: inventory_hostname | match("[a-z0-9]([-a-z0-9]*[a-z0-9])?$") |
|
|
|
msg: "Hostname must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character" |
|
|
|
ignore_errors: "{{ ignore_assert_errors }}" |