Puppet hieradata does not properly interpret an IPv4-mapped IPv6 address

Bug #2050307 reported by Tara Nath Subedi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Tara Nath Subedi

Bug Description

Brief Description
-----------------
IPv6 IPv4-mapped prefix of ::ffff is being interpreted by puppet as a Hiera parameter reference, causing a Hiera parameter lookup error.

To support interoperating with IPv4 systems on IPv6 deployments it is necessary to configure IPv4-mapped IPv6 addresses. Specifically, this is required for DNS entries that cannot use host entries as an alternative.

Severity
--------
Major: System/Feature is usable but degraded

Steps to Reproduce
------------------
To simply reproduce the Puppet error, a DNS configuration using the following can be configured.

system dns-modify nameservers=::ffff:10.10.10.1

Expected Behavior
------------------
The hiera data must be formatted with an expanded value that is not interpreted as a hiera data parameter reference.

Example:

import netaddr
a = netaddr.IPAddress("::ffff:10.10.10.1")
a.format(netaddr.ipv6_full)

'0:0:0:0:0:ffff:a0a:a01'

Actual Behavior
----------------
Puppet error is generated.

Reproducibility
---------------
Reproducible - 100%

System Configuration
--------------------
Any IPv6-based system.

Branch/Pull Time/Commit
-----------------------
STX master 2023-12-11_10:44:56

Last Pass
---------
Never - new test scenario.

Timestamp/Logs
--------------
Example Log Error

2023-12-11T12:44:56.292 Error: 2023-12-11 12:44:56 +0000 Evaluation Error: Error while evaluating a Function Call, Lookup of key 'platform::dns::resolv::servers' failed:
Value for key 'platform::dns::resolv::servers', in hash returned from data_hash function 'yaml_data', when using location '/tmp/puppet/hieradata/system.yaml', has wrong type,
expects Puppet::LookupValue, got Array[Any, 2, 2] (file: /usr/share/puppet/modules/platform/manifests/dns.pp, line: 79, column: 3) on node controller-0

Test Activity
-------------
Validating dual-stack deployment configuration

Workaround
----------
Manually update database with expanded notation that eliminates leading colons.

sudo -u postgres psql -d sysinv -c "update i_dns set nameservers='0:0:0:0:0:ffff:10.10.10.1';"

Changed in starlingx:
assignee: nobody → Tara Nath Subedi (tsubedi)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to config (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/config/+/906302

Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Medium
tags: added: stx.9.0 stx.networking
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to config (master)

Reviewed: https://review.opendev.org/c/starlingx/config/+/906302
Committed: https://opendev.org/starlingx/config/commit/51fe2ced224a18ca7e4201e89ceb1515fb76851a
Submitter: "Zuul (22348)"
Branch: master

commit 51fe2ced224a18ca7e4201e89ceb1515fb76851a
Author: Tara Subedi <email address hidden>
Date: Fri Jan 19 11:24:08 2024 -0500

    Puppet hieradata does not properly interpret an IPv4-mapped IPv6

    IPv6 IPv4-mapped prefix ::ffff is being interpreted by puppet as
    a Hiera parameter reference, causing a Hiera parameter lookup
    error. "puppet lookup platform::dns::resolv::servers" shows error
    when the value in yaml file leads with ::. This commit fixes the
    issue by putting the value in quote on yaml dump.

    TEST PLAN:
        PASS: Bootstrap with dns_servers ::ffff:10.10.10.1
        PASS: system dns-modify nameservers=::ffff:10.10.10.1

    Closes-Bug: 2050307
    Change-Id: I40cf7a02b22db7fa1c51414a802b969a395db61f
    Signed-off-by: Tara Nath Subedi <email address hidden>

Changed in starlingx:
status: In Progress → 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.