summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2015-11-24 16:45:43 -0500
committerBrenton Leanhardt <bleanhar@redhat.com>2015-11-24 16:45:43 -0500
commit1b9d5b8dbda0819e3edd1255f3ae07821e9c1a7b (patch)
tree33d449f540d21525569d8003e2f92c0b62d14edc
parente728f3aa7238afeddcc6dbf7d11cb5ea2a51c22f (diff)
parent993785d915b08ad3c1d25faf20759e80733d77d0 (diff)
downloadopenshift-1b9d5b8dbda0819e3edd1255f3ae07821e9c1a7b.tar.gz
openshift-1b9d5b8dbda0819e3edd1255f3ae07821e9c1a7b.tar.bz2
openshift-1b9d5b8dbda0819e3edd1255f3ae07821e9c1a7b.tar.xz
openshift-1b9d5b8dbda0819e3edd1255f3ae07821e9c1a7b.zip
Merge pull request #967 from detiber/setHostname
Rework setting of hostname
-rw-r--r--inventory/byo/hosts.example5
-rw-r--r--roles/openshift_common/tasks/main.yml13
2 files changed, 18 insertions, 0 deletions
diff --git a/inventory/byo/hosts.example b/inventory/byo/hosts.example
index 50a683cfc..ef0736b63 100644
--- a/inventory/byo/hosts.example
+++ b/inventory/byo/hosts.example
@@ -149,6 +149,11 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
# interface other than the default network interface.
#openshift_node_set_node_ip=True
+# Force setting of system hostname when configuring OpenShift
+# This works around issues related to installations that do not have valid dns
+# entries for the interfaces attached to the host.
+#openshift_set_hostname=True
+
# host group for masters
[masters]
ose3-master[1:3]-ansible.test.example.com
diff --git a/roles/openshift_common/tasks/main.yml b/roles/openshift_common/tasks/main.yml
index e9df4e364..55065b3de 100644
--- a/roles/openshift_common/tasks/main.yml
+++ b/roles/openshift_common/tasks/main.yml
@@ -3,6 +3,10 @@
msg: Flannel can not be used with openshift sdn
when: openshift_use_openshift_sdn | default(false) | bool and openshift_use_flannel | default(false) | bool
+- fail:
+ msg: openshift_hostname must be 64 characters or less
+ when: openshift_hostname is defined and openshift_hostname | length > 64
+
- name: Set common Cluster facts
openshift_facts:
role: common
@@ -18,3 +22,12 @@
deployment_type: "{{ openshift_deployment_type }}"
use_fluentd: "{{ openshift_use_fluentd | default(None) }}"
use_flannel: "{{ openshift_use_flannel | default(None) }}"
+
+ # For enterprise versions < 3.1 and origin versions < 1.1 we want to set the
+ # hostname by default.
+- set_fact:
+ set_hostname_default: "{{ not openshift.common.version_greater_than_3_1_or_1_1 }}"
+
+- name: Set hostname
+ hostname: name={{ openshift.common.hostname }}
+ when: openshift_set_hostname | default(set_hostname_default) | bool