From 86a0cc2cae4fd84beeecc29970c43204a773bdb3 Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Mon, 16 Apr 2018 12:18:57 +0200 Subject: [PATCH 1/2] Set OpenStack VM hostname to the entry in Nova OpenStack appends a domain suffix (`.novalocal` by default) to the hostnames of the VMs it creates. This clashes with the new control plane install tasks that look at the hostname rather than the `openshift_hostname` variable. This makes the OpenStack playbooks function again with the new control plane/bootstrap installation. --- roles/openshift_openstack/tasks/node-configuration.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/openshift_openstack/tasks/node-configuration.yml b/roles/openshift_openstack/tasks/node-configuration.yml index 59df2e396d0..ed6eee9ff60 100644 --- a/roles/openshift_openstack/tasks/node-configuration.yml +++ b/roles/openshift_openstack/tasks/node-configuration.yml @@ -1,4 +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 + hostname: + name: "{{ openshift_hostname }}" + - name: "Verify SELinux is enforcing" fail: msg: "SELinux is required for OpenShift and has been detected as '{{ ansible_selinux.config_mode }}'" From 5c83e466e29f16abd50692a3f06bd7b9fee93adc Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Tue, 17 Apr 2018 14:13:32 +0200 Subject: [PATCH 2/2] 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. --- roles/openshift_openstack/defaults/main.yml | 1 + roles/openshift_openstack/tasks/node-configuration.yml | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/openshift_openstack/defaults/main.yml b/roles/openshift_openstack/defaults/main.yml index 9cc03c32487..7179a52ea53 100644 --- a/roles/openshift_openstack/defaults/main.yml +++ b/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 }}" diff --git a/roles/openshift_openstack/tasks/node-configuration.yml b/roles/openshift_openstack/tasks/node-configuration.yml index ed6eee9ff60..a21c3e2c06e 100644 --- a/roles/openshift_openstack/tasks/node-configuration.yml +++ b/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: