Nova consoles HAProxy config fails to template

Bug #2029209 reported by Andrew Bonney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Undecided
Unassigned

Bug Description

During a Zed->Antelope upgrade running os-nova-install, the HAProxy config step fails as follows:

TASK [haproxy_server : Create haproxy service config files] ***********************************************************************************************************************************************
ok: [haproxy1] => <nova_api_metadata content omitted>
ok: [haproxy1] => <nova_api_os_compute content omitted>
fatal: [haproxy1]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'ansible.utils.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'haproxy_service_name'
\n\nThe error appears to be in '/etc/ansible/roles/haproxy_server/tasks/haproxy_service_config.yml': line 31, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe off
ending line appears to be:\n\n\n- name: Create haproxy service config files\n ^ here\n"}

The previous tasks show that the various nova console HAProxy configs fail to template. Digging into this suggests that ansible_facts['architecture'] is undefined from https://github.com/openstack/openstack-ansible/blob/d1e30257ae0c818780684fe77e1b34ba4dd0dc40/inventory/group_vars/all/nova.yml#L27 and is causing the problem. This appears to be because whilst facts are gathered for the HAProxy servers themselves here: https://github.com/openstack/openstack-ansible/blob/master/playbooks/common-playbooks/haproxy-service-config.yml#L35, they are not gathered for the Nova API containers here: https://github.com/openstack/openstack-ansible/blob/master/playbooks/common-playbooks/haproxy-service-config.yml#L26, and it seems that Ansible wants to evaluate the variables when they are assigned to the HAProxy hosts' vars here: https://github.com/openstack/openstack-ansible/blob/master/playbooks/common-playbooks/haproxy-service-config.yml#L32. os-nova-install was run a long time after setup-hosts, so any previously gathered facts would likely have expired.

I wonder if some limited fact gathering might be necessary in https://github.com/openstack/openstack-ansible/blob/master/playbooks/common-playbooks/haproxy-service-config.yml#L26, both to cover this case and in case anyone was to deploy their own HAProxy service config vars which reference Ansible facts.

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote :

Can you kindly test this patch [1]? It should cover the issue you've reported

[1] https://review.opendev.org/c/openstack/openstack-ansible/+/889023

Revision history for this message
Andrew Bonney (andrewbonney) wrote :

It looks like that patch does resolve the issue.

Changed in openstack-ansible:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.