소스 검색

Use `inventory_hostname` not `openshift_hostname`

The latter can be an IP address. But `inventory_hostname` is always
the same as the name in Nova.
Tomas Sedovic 7 년 전
부모
커밋
5c83e466e2
2개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 0
      roles/openshift_openstack/defaults/main.yml
  2. 3 2
      roles/openshift_openstack/tasks/node-configuration.yml

+ 1 - 0
roles/openshift_openstack/defaults/main.yml

@@ -69,6 +69,7 @@ openshift_openstack_cns_hostname: cns
 openshift_openstack_node_hostname: app-node
 openshift_openstack_lb_hostname: lb
 openshift_openstack_etcd_hostname: etcd
+openshift_openstack_set_hostname_to_compute_name: true
 openshift_openstack_keypair_name: openshift
 openshift_openstack_lb_flavor: "{{ openshift_openstack_default_flavor }}"
 openshift_openstack_etcd_flavor: "{{ openshift_openstack_default_flavor }}"

+ 3 - 2
roles/openshift_openstack/tasks/node-configuration.yml

@@ -1,9 +1,10 @@
 ---
 # NOTE(shadower): we need to do this because some of the install tasks seem to
 # ignore openshift_hostname and rely on the actual system's hostname
-- name: Update hostname to openshift_hostname
+- name: Update hostname to match the OpenStack name
   hostname:
-    name: "{{ openshift_hostname }}"
+    name: "{{ inventory_hostname }}"
+  when: openshift_openstack_set_hostname_to_compute_name
 
 - name: "Verify SELinux is enforcing"
   fail: