Setting ipxe_enabled un undercloud.conf doesn't work

Bug #1743679 reported by Tony Breeds
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Tony Breeds

Bug Description

In trying to disable iPXE boot (for development of the multiarch blueprint) It seems that ipxe is still enabled:

[stack@director ~]$ grep ipxe_enabled undercloud.conf
#ipxe_enabled = true
ipxe_enabled = false
[stack@director ~]$ sudo grep -E '(pxe_transfer|ipxe_enabled)' /etc/puppet/hieradata/puppet-stack-config.yaml
ironic::inspector::pxe_transfer_protocol: 'http'
ironic::drivers::pxe::ipxe_enabled: False
[stack@director ~]$ grep -i1 ipxe_enabled /usr/share/instack-undercloud/puppet-stack-config/puppet-stack-config.yaml.template
ironic::inspector::debug: "%{hiera('debug')}"
{{#IPXE_ENABLED}}
ironic::inspector::pxe_transfer_protocol: 'http'
{{/IPXE_ENABLED}}
ironic::inspector::enable_uefi: {{INSPECTION_ENABLE_UEFI}}
--
# Ironic pxe
ironic::drivers::pxe::ipxe_enabled: {{IPXE_ENABLED}}
# NOTE(dtantsur): UEFI only works with iPXE currently for us

This seems to be because pystache treats the string 'False' as a true value[1]. This isn't a bug in pystache as such.

See:

>>> import pystache
>>> template="""
... {{#IPXE_ENABLED}}
... ironic::inspector::pxe_transfer_protocol: 'http'
... {{/IPXE_ENABLED}}
... """
>>> print pystache.render(template, dict(IPXE_ENABLED='False'))

ironic::inspector::pxe_transfer_protocol: 'http'

>>> print pystache.render(template, dict(IPXE_ENABLED=None))

>>> print pystache.render(template, dict(IPXE_ENABLED=False))

>>>

[1] http://mustache.github.io/mustache.5.html

Tony Breeds (o-tony)
Changed in tripleo:
assignee: nobody → Tony Breeds (o-tony)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to instack-undercloud (master)

Fix proposed to branch: master
Review: https://review.openstack.org/534604

Revision history for this message
Tony Breeds (o-tony) wrote :

With the change above I get the expected results:

[stack@director ~]$ grep ipxe_enabled undercloud.conf
#ipxe_enabled = true
ipxe_enabled = false
[stack@director ~]$ sudo grep -E '(pxe_transfer|ipxe_enabled)' /etc/puppet/hieradata/puppet-stack-config.yaml
ironic::drivers::pxe::ipxe_enabled: False
[stack@director ~]$ grep -i1 ipxe_enabled /usr/share/instack-undercloud/puppet-stack-config/puppet-stack-config.yaml.template
ironic::inspector::debug: "%{hiera('debug')}"
{{#IPXE_ENABLED}}
ironic::inspector::pxe_transfer_protocol: 'http'
{{/IPXE_ENABLED}}
ironic::inspector::enable_uefi: {{INSPECTION_ENABLE_UEFI}}
--
# Ironic pxe
ironic::drivers::pxe::ipxe_enabled: {{IPXE_ENABLED}}
# NOTE(dtantsur): UEFI only works with iPXE currently for us

Changed in tripleo:
milestone: none → queens-3
importance: Undecided → High
Changed in tripleo:
milestone: queens-3 → queens-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to instack-undercloud (master)

Reviewed: https://review.openstack.org/534604
Committed: https://git.openstack.org/cgit/openstack/instack-undercloud/commit/?id=28fd5228860d4aeea1bcf7de13d9a4eb8ed6d643
Submitter: Zuul
Branch: master

commit 28fd5228860d4aeea1bcf7de13d9a4eb8ed6d643
Author: Tony Breeds <email address hidden>
Date: Wed Jan 17 14:16:09 2018 +1100

    Ensure Boolean Strings from the environment are treated correctly

    This happens because we use six.text_type() to convert the oslo.config
    options into a strings so we can pass it via environment
    variables[1,2,3].

    [1] http://git.openstack.org/cgit/openstack/instack-undercloud/tree/instack_undercloud/undercloud.py#n1229
    [2] http://git.openstack.org/cgit/openstack/instack-undercloud/tree/instack_undercloud/undercloud.py#n1371
    [3] http://git.openstack.org/cgit/openstack/instack-undercloud/tree/instack_undercloud/undercloud.py#n550

    Change-Id: I5830a856960856af1a045d6eda609b8abb20658d
    Closes-Bug: 1743679

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/instack-undercloud 8.3.0

This issue was fixed in the openstack/instack-undercloud 8.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to instack-undercloud (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/591649

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to instack-undercloud (stable/pike)

Reviewed: https://review.openstack.org/591649
Committed: https://git.openstack.org/cgit/openstack/instack-undercloud/commit/?id=d988d98e558ef5016fca14ecb10ed1664166b292
Submitter: Zuul
Branch: stable/pike

commit d988d98e558ef5016fca14ecb10ed1664166b292
Author: Tony Breeds <email address hidden>
Date: Wed Jan 17 14:16:09 2018 +1100

    Ensure Boolean Strings from the environment are treated correctly

    This happens because we use six.text_type() to convert the oslo.config
    options into a strings so we can pass it via environment
    variables[1,2,3].

    [1] http://git.openstack.org/cgit/openstack/instack-undercloud/tree/instack_undercloud/undercloud.py#n1229
    [2] http://git.openstack.org/cgit/openstack/instack-undercloud/tree/instack_undercloud/undercloud.py#n1371
    [3] http://git.openstack.org/cgit/openstack/instack-undercloud/tree/instack_undercloud/undercloud.py#n550

    Change-Id: I5830a856960856af1a045d6eda609b8abb20658d
    Closes-Bug: 1743679
    (cherry picked from commit 28fd5228860d4aeea1bcf7de13d9a4eb8ed6d643)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/instack-undercloud 7.4.15

This issue was fixed in the openstack/instack-undercloud 7.4.15 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.