HAProxy role has a compatibility issue with Ansible 2.9

Bug #1852430 reported by Dincer Celik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
Low
Dincer Celik
Stein
Fix Released
Low
Unassigned
Train
Fix Released
Low
Unassigned
Ussuri
Fix Released
Low
Dincer Celik

Bug Description

See error below. Problem is https://github.com/openstack/kolla-ansible/blob/master/ansible/roles/haproxy/templates/haproxy_main.cfg.j2#L10

TASK [haproxy : Copying over haproxy.cfg] ******************************************************************************************************************************************************************failed: [control04.idc.trendyol.com] (item=/usr/local/share/kolla-ansible/ansible/roles/haproxy/templates/haproxy_main.cfg.j2) => {"ansible_loop_var": "item", "changed": false, "item": "/usr/local/share/kolla-ansible/ansible/roles/haproxy/templates/haproxy_main.cfg.j2", "msg": "AnsibleError: Unexpected templating type error occurred on (global\n chroot /var/lib/haproxy\n user haproxy\n group haproxy\n daemon\n log {{ syslog_server }}:{{ syslog_udp_port }} {{ syslog_haproxy_facility }}\n maxconn {{ haproxy_max_connections }}\n nbproc {{ haproxy_processes }}\n {% if haproxy_processes
 > 1 and haproxy_process_cpu_map | bool %}\n {% for cpu_idx in range(0, haproxy_processes) %}\n cpu-map {{ cpu_idx + 1 }} {{ cpu_idx }}\n {% endfor %}\n {% endif %}\n stats socket /var/lib/kolla/haproxy/haproxy.sock group kolla mode 660\n {% if kolla_enable_tls_external | bool %}\n ssl-default-bind-ciphers DEFAULT:!MEDIUM:!3DES\n ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11\n tune.ssl.default-dh-param 4096\n {% endif %}\n\ndefaults\n log global\n option redispatch\n retries 3\n timeout http-request {{ haproxy_http_request_timeout }}\n timeout queue {{ haproxy_queue_timeout }}\n timeout connect {{ haproxy_connect_timeout }}\n timeout client {{ haproxy_client_timeout }}\n timeout server {{ haproxy_server_timeout }}\n timeout check {{ haproxy_check_timeout }}\n balance {{ haproxy_defaults_balance }}\n\nlisten stats\n bind {{ api_interface_address }}:{{ haproxy_stats_port }}\n mode http\n stats enable\n stats uri /\n stats
refresh 15s\n stats realm Haproxy\\ Stats\n stats auth {{ haproxy_user }}:{{ haproxy_password }}\n\nfrontend status\n bind {{ api_interface_address }}:{{ haproxy_monitor_port }}\n {% if api_interface_address != kolla_internal_vip_address %}\n bind {{ kolla_internal_vip_address }}:{{ haproxy_monitor_port }}\n {% endif %}\n mode http\n monitor-uri /\n): '>' not supported between instances of 'str' and 'int'"}

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)

Fix proposed to branch: master
Review: https://review.opendev.org/694058

Changed in kolla-ansible:
assignee: nobody → Dincer Celik (osmanlicilegi)
status: New → In Progress
Revision history for this message
Dincer Celik (dincercelik) wrote :

To reproduce this bug, you need to set haproxy_processes in globals.yml, e.g. haproxy_processes: "1"

The problem occurs when an integer variable is set in double quotes, and has a conditional check somewhere. This was not a problem until ansible 2.9.

In my opinion, this issue proves the ansible max version pinning discussed at ptg is an important improvement.

Revision history for this message
Mark Goddard (mgoddard) wrote :

I might argue that setting haproxy_processes to a string is unexpected. I suppose we can help here though.

Changed in kolla-ansible:
importance: Undecided → Low
Revision history for this message
Dincer Celik (dincercelik) wrote :

I agree with you Mark, integers shouldn't be defined as string, but the user behavior sometimes differs you know. Also, k-a has integers defined as string which might cause confusion.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (master)

Reviewed: https://review.opendev.org/694058
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=4f216b3d28ac0d3e6ff2dabab17cf830cde14699
Submitter: Zuul
Branch: master

commit 4f216b3d28ac0d3e6ff2dabab17cf830cde14699
Author: Dincer Celik <email address hidden>
Date: Wed Nov 13 15:26:08 2019 +0300

    Fixes the compatibility issue at HAProxy role with Ansible 2.9

    Change-Id: I36b858b9b03005feabd77e7208674f37c820e9d4
    Closes-Bug: #1852430

Changed in kolla-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/695851

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/695870

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/train)

Reviewed: https://review.opendev.org/695851
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=32ff3194070b69fdc602f1d1d4f87daa4c9a808e
Submitter: Zuul
Branch: stable/train

commit 32ff3194070b69fdc602f1d1d4f87daa4c9a808e
Author: Dincer Celik <email address hidden>
Date: Wed Nov 13 15:26:08 2019 +0300

    Fixes the compatibility issue at HAProxy role with Ansible 2.9

    Change-Id: I36b858b9b03005feabd77e7208674f37c820e9d4
    Closes-Bug: #1852430
    (cherry picked from commit 4f216b3d28ac0d3e6ff2dabab17cf830cde14699)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/stein)

Reviewed: https://review.opendev.org/695870
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=22dc156773bd75e2a555986484e2b621a9bd9d2b
Submitter: Zuul
Branch: stable/stein

commit 22dc156773bd75e2a555986484e2b621a9bd9d2b
Author: Dincer Celik <email address hidden>
Date: Wed Nov 13 15:26:08 2019 +0300

    Fixes the compatibility issue at HAProxy role with Ansible 2.9

    Change-Id: I36b858b9b03005feabd77e7208674f37c820e9d4
    Closes-Bug: #1852430
    (cherry picked from commit 4f216b3d28ac0d3e6ff2dabab17cf830cde14699)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 9.0.0.0rc2

This issue was fixed in the openstack/kolla-ansible 9.0.0.0rc2 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 8.1.0

This issue was fixed in the openstack/kolla-ansible 8.1.0 release.

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.