Browse Source

Add error msg for check of local ip (#6761)

When stopping at the check of "Stop if ip var does not match local ips"
the error message is like:

  fatal: [single-k8s]: FAILED! => {
      "assertion": "ip in ansible_all_ipv4_addresses",
      "changed": false,
      "evaluated_to": false,
      "msg": "Assertion failed"
  }

That doesn't contain actual IP addresses and it is difficult to understand
what was wrong. This adds the error message which contain actual IP addresses
to investigate the issue if happens.
pull/6765/head
Kenichi Omichi 4 years ago
committed by GitHub
parent
commit
109391031b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions
  1. 1
      roles/kubernetes/preinstall/tasks/0020-verify-settings.yml

1
roles/kubernetes/preinstall/tasks/0020-verify-settings.yml

@ -95,6 +95,7 @@
- name: Stop if ip var does not match local ips - name: Stop if ip var does not match local ips
assert: assert:
that: ip in ansible_all_ipv4_addresses that: ip in ansible_all_ipv4_addresses
msg: "'{{ ansible_all_ipv4_addresses }}' do not contain '{{ ip }}'"
when: when:
- not ignore_assert_errors - not ignore_assert_errors
- ip is defined - ip is defined

Loading…
Cancel
Save