Bifrost role doesn't preserve Multiline-YAML configuration

Bug #2014980 reported by Maksim Malchuk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
Medium
Maksim Malchuk
Xena
Fix Released
Undecided
Maksim Malchuk
Yoga
Fix Released
Undecided
Maksim Malchuk
Zed
Fix Released
Undecided
Maksim Malchuk

Bug Description

Deploying the Bifrost in Kayobe with ${KAYOBE_CONFIG_PATH}/bifrost.yml contains:

kolla_bifrost_dib_env_vars_extra:
  DIB_BLOCK_DEVICE_CONFIG: |-
    - local_loop:
        name: image0
        size: 200GiB
    - partitioning:
        name: gpt
        base: image0
        label: gpt
        partitions:
          - name: ESP
            size: 550MiB
            type: 'EF00'
          - name: BSP
            size: 2MiB
            type: 'EF02'
          - name: LVM2
            size: 100%
            type: '8E00'
# ... partial data provided ...

produces the /etc/kolla/bifrost/dib.yml on 'seed' host and /etc/bifrost/dib.yml in 'bifrost-deploy' container with an extra linebreaks:

dib_env_vars:
  DIB_BLOCK_DEVICE_CONFIG: "- local_loop:\n name: image0\n size: 200GiB\n- partitioning:\n\
    \ name: gpt\n base: image0\n label: gpt\n partitions:\n - name:\
    \ ESP\n size: 550MiB\n type: 'EF00'\n - name: BSP\n \
    \ size: 2MiB\n type: 'EF02'\n - name: LVM2\n size: 100%\n \
    \ type: '8E00'\n"
# ... partial data provided ...

the file is not well human readable and it is hard to parse it with standard tools.

Changed in kolla-ansible:
status: New → In Progress
assignee: nobody → Maksim Malchuk (mmalchuk)
Revision history for this message
Maksim Malchuk (mmalchuk) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (master)

Reviewed: https://review.opendev.org/c/openstack/kolla-ansible/+/833633
Committed: https://opendev.org/openstack/kolla-ansible/commit/47862b56bd90c3edaab3345577901367a73cfd98
Submitter: "Zuul (22348)"
Branch: master

commit 47862b56bd90c3edaab3345577901367a73cfd98
Author: Maksim Malchuk <email address hidden>
Date: Tue Mar 1 01:20:38 2022 +0300

    Fix maximum width of the DIB Multiline-YAML

    The dib_env_vars variable in the Bifrost's dib.yml file can contain
    the DIB_BLOCK_DEVICE_CONFIG environment variable which is always the
    Multiline-YAML data. By default, the format of the data is not
    preserved while the configuration is merged and saved for the
    bifrost-deploy container.

    This is because Ansible uses the PyYAML library which has a default
    80 symbol string length limit. The official Ansible documentation [1]
    recommends using to_yaml or to_nice_yaml filters with width parameter.
    This change adds the same ability to the merge_yaml Ansible plugin.

    1. https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#formatting-data-yaml-and-json

    The related change for the diskimage-builder to solve the issue with
    incorrect data provided by Kolla-Ansible is also provided:
    I3b74ede69eb064ad813a9108ec68a228e549e8bb

    Closes-Bug: #2014980
    Related-Bug: #2014981
    Change-Id: Id79445c0311916ac6c1beb3986e14f652ee5a63c
    Signed-off-by: Maksim Malchuk <email address hidden>

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/zed)

Fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/kolla-ansible/+/880756

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

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/kolla-ansible/+/880757

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

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/kolla-ansible/+/880758

Changed in kolla-ansible:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/kolla-ansible/+/880756
Committed: https://opendev.org/openstack/kolla-ansible/commit/c78f8569b389a5a24c7b124f0ff4eebe1a0a9bca
Submitter: "Zuul (22348)"
Branch: stable/zed

commit c78f8569b389a5a24c7b124f0ff4eebe1a0a9bca
Author: Maksim Malchuk <email address hidden>
Date: Tue Mar 1 01:20:38 2022 +0300

    Fix maximum width of the DIB Multiline-YAML

    The dib_env_vars variable in the Bifrost's dib.yml file can contain
    the DIB_BLOCK_DEVICE_CONFIG environment variable which is always the
    Multiline-YAML data. By default, the format of the data is not
    preserved while the configuration is merged and saved for the
    bifrost-deploy container.

    This is because Ansible uses the PyYAML library which has a default
    80 symbol string length limit. The official Ansible documentation [1]
    recommends using to_yaml or to_nice_yaml filters with width parameter.
    This change adds the same ability to the merge_yaml Ansible plugin.

    1. https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#formatting-data-yaml-and-json

    The related change for the diskimage-builder to solve the issue with
    incorrect data provided by Kolla-Ansible is also provided:
    I3b74ede69eb064ad813a9108ec68a228e549e8bb

    Closes-Bug: #2014980
    Related-Bug: #2014981
    Change-Id: Id79445c0311916ac6c1beb3986e14f652ee5a63c
    Signed-off-by: Maksim Malchuk <email address hidden>
    (cherry picked from commit 47862b56bd90c3edaab3345577901367a73cfd98)

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

Reviewed: https://review.opendev.org/c/openstack/kolla-ansible/+/880757
Committed: https://opendev.org/openstack/kolla-ansible/commit/486367ec60ffa32fb58151f84f38460c41956cd2
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 486367ec60ffa32fb58151f84f38460c41956cd2
Author: Maksim Malchuk <email address hidden>
Date: Tue Mar 1 01:20:38 2022 +0300

    Fix maximum width of the DIB Multiline-YAML

    The dib_env_vars variable in the Bifrost's dib.yml file can contain
    the DIB_BLOCK_DEVICE_CONFIG environment variable which is always the
    Multiline-YAML data. By default, the format of the data is not
    preserved while the configuration is merged and saved for the
    bifrost-deploy container.

    This is because Ansible uses the PyYAML library which has a default
    80 symbol string length limit. The official Ansible documentation [1]
    recommends using to_yaml or to_nice_yaml filters with width parameter.
    This change adds the same ability to the merge_yaml Ansible plugin.

    1. https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#formatting-data-yaml-and-json

    The related change for the diskimage-builder to solve the issue with
    incorrect data provided by Kolla-Ansible is also provided:
    I3b74ede69eb064ad813a9108ec68a228e549e8bb

    Closes-Bug: #2014980
    Related-Bug: #2014981
    Change-Id: Id79445c0311916ac6c1beb3986e14f652ee5a63c
    Signed-off-by: Maksim Malchuk <email address hidden>
    (cherry picked from commit 47862b56bd90c3edaab3345577901367a73cfd98)

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

Reviewed: https://review.opendev.org/c/openstack/kolla-ansible/+/880758
Committed: https://opendev.org/openstack/kolla-ansible/commit/6dbb86fd0c9678e2db4e0a4d3fb526ba6526b62b
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 6dbb86fd0c9678e2db4e0a4d3fb526ba6526b62b
Author: Maksim Malchuk <email address hidden>
Date: Tue Mar 1 01:20:38 2022 +0300

    Fix maximum width of the DIB Multiline-YAML

    The dib_env_vars variable in the Bifrost's dib.yml file can contain
    the DIB_BLOCK_DEVICE_CONFIG environment variable which is always the
    Multiline-YAML data. By default, the format of the data is not
    preserved while the configuration is merged and saved for the
    bifrost-deploy container.

    This is because Ansible uses the PyYAML library which has a default
    80 symbol string length limit. The official Ansible documentation [1]
    recommends using to_yaml or to_nice_yaml filters with width parameter.
    This change adds the same ability to the merge_yaml Ansible plugin.

    1. https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#formatting-data-yaml-and-json

    The related change for the diskimage-builder to solve the issue with
    incorrect data provided by Kolla-Ansible is also provided:
    I3b74ede69eb064ad813a9108ec68a228e549e8bb

    Closes-Bug: #2014980
    Related-Bug: #2014981
    Change-Id: Id79445c0311916ac6c1beb3986e14f652ee5a63c
    Signed-off-by: Maksim Malchuk <email address hidden>
    (cherry picked from commit 47862b56bd90c3edaab3345577901367a73cfd98)

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

This issue was fixed in the openstack/kolla-ansible 16.0.0.0rc1 release candidate.

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

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

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

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

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

This issue was fixed in the openstack/kolla-ansible xena-eol 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.