diff options
author | Jason DeTiberus <jdetiber@redhat.com> | 2015-11-24 13:05:07 -0500 |
---|---|---|
committer | Jason DeTiberus <jdetiber@redhat.com> | 2015-11-24 15:12:51 -0500 |
commit | 993785d915b08ad3c1d25faf20759e80733d77d0 (patch) | |
tree | 90b095c2c851ca6086c873382a9e8b108c5b6a39 /roles/openshift_common/tasks | |
parent | 89c20890323f2693fdc3174c4cd3d19e7addc817 (diff) | |
download | openshift-993785d915b08ad3c1d25faf20759e80733d77d0.tar.gz openshift-993785d915b08ad3c1d25faf20759e80733d77d0.tar.bz2 openshift-993785d915b08ad3c1d25faf20759e80733d77d0.tar.xz openshift-993785d915b08ad3c1d25faf20759e80733d77d0.zip |
Rework setting of hostname
- set the hostname for all installs < 3.1 or 1.1
- provide a new variable openshift_set_hostname to override default behavior
Diffstat (limited to 'roles/openshift_common/tasks')
-rw-r--r-- | roles/openshift_common/tasks/main.yml | 13 |
1 files changed, 13 insertions, 0 deletions
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 |