diff options
author | Russell Teague <rteague@redhat.com> | 2017-11-03 17:28:45 -0400 |
---|---|---|
committer | Russell Teague <rteague@redhat.com> | 2017-11-15 13:35:10 -0500 |
commit | e5f4823d6e4191367178f743ddd5e0885598e8cf (patch) | |
tree | 10877c2ae156d1362f1394177cb02942951db24e /playbooks/init/validate_hostnames.yml | |
parent | c49dd26ba094b96da1e234d8ea355861a5220c99 (diff) | |
download | openshift-e5f4823d6e4191367178f743ddd5e0885598e8cf.tar.gz openshift-e5f4823d6e4191367178f743ddd5e0885598e8cf.tar.bz2 openshift-e5f4823d6e4191367178f743ddd5e0885598e8cf.tar.xz openshift-e5f4823d6e4191367178f743ddd5e0885598e8cf.zip |
Playbook Consolidation - Initialization
Diffstat (limited to 'playbooks/init/validate_hostnames.yml')
-rw-r--r-- | playbooks/init/validate_hostnames.yml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/playbooks/init/validate_hostnames.yml b/playbooks/init/validate_hostnames.yml new file mode 100644 index 000000000..be2e6a15a --- /dev/null +++ b/playbooks/init/validate_hostnames.yml @@ -0,0 +1,23 @@ +--- +- name: Validate node hostnames + hosts: oo_nodes_to_config + tasks: + - name: Query DNS for IP address of {{ openshift.common.hostname }} + shell: + getent ahostsv4 {{ openshift.common.hostname }} | head -n 1 | awk '{ print $1 }' + register: lookupip + changed_when: false + failed_when: false + - name: Warn user about bad openshift_hostname values + pause: + prompt: + The hostname {{ openshift.common.hostname }} for {{ ansible_nodename }} + doesn't resolve to an IP address owned by this host. Please set + openshift_hostname variable to a hostname that when resolved on the host + in question resolves to an IP address matching an interface on this + host. This host will fail liveness checks for pods utilizing hostPorts, + press ENTER to continue or CTRL-C to abort. + seconds: "{{ 10 if openshift_override_hostname_check | default(false) | bool else omit }}" + when: + - lookupip.stdout != '127.0.0.1' + - lookupip.stdout not in ansible_all_ipv4_addresses |