Jira (FACT-3135) YAML anchors no longer function properly in Facter 4

10 views
Skip to first unread message

Nathanael Cole (Jira)

unread,
Jul 8, 2022, 12:20:02 PM7/8/22
to puppe...@googlegroups.com
Nathanael Cole created an issue
 
Facter / Task FACT-3135
YAML anchors no longer function properly in Facter 4
Issue Type: Task Task
Affects Versions: FACT 4.2.8
Assignee: Unassigned
Components: Facter 4
Created: 2022/07/08 9:19 AM
Priority: Normal Normal
Reporter: Nathanael Cole

It appears that yaml anchors have stopped working in facter 4. In facter 3, this external yaml fact is processed correctly:

 

// "/opt/puppetlabs/facter/facts.d/test.yaml" 13L, 118C                                                  9,7           All
---
one:
  ipam:
    a:
      &a1
      - foo
    cname:
      &a2
      - bar
two:
  IPAM:
    A: *a1
    CNAME: *a2 

 

When running puppet facts --debug:

 

 

// ESC[0;36mDebug: Facter: resolving facts from YAML file "/opt/puppetlabs/facter/facts.d/test.yaml".ESC[0m
ESC[0;36mDebug: Facter: fact "one" has resolved to {
  ipam => {
    a => [
      "foo"
    ],
    cname => [
      "bar"
    ]
  }
}.ESC[0m 

In facter 4, this fails:

 

// c:Error: Facter: Failed to handle /opt/puppetlabs/facter/facts.d/test.yaml as LegacyFacter::Util::Parser::YamlParser facts: Unknown alias: a1

The expectation is that yaml anchors should function the same as they did in prior versions. Support has recommended their use on multiple prior occasions.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Alvin Rodis (Jira)

unread,
Jul 8, 2022, 12:22:02 PM7/8/22
to puppe...@googlegroups.com
Alvin Rodis updated an issue
Change By: Alvin Rodis
Labels: jira_escalated

Alvin Rodis (Jira)

unread,
Jul 8, 2022, 12:23:01 PM7/8/22
to puppe...@googlegroups.com
Alvin Rodis updated an issue
Change By: Alvin Rodis
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 48920

Nathanael Cole (Jira)

unread,
Jul 8, 2022, 12:30:01 PM7/8/22
to puppe...@googlegroups.com
Nathanael Cole updated an issue
Change By: Nathanael Cole
It appears that yaml anchors have stopped working in facter 4. In facter 3, this external yaml fact is processed correctly:

 
{code:java}
// "/opt/puppetlabs/facter/facts.d/test.yaml" 13L, 118C                                                  9,7           All
---
one:
  ipam:
    a:
      &a1
      - foo
    cname:
      &a2
      - bar
two:
  IPAM:
    A: *a1
    CNAME: *a2 {code}
 

When running puppet facts --debug:

 

 
{code:java}
// ESC[0;36mDebug: Facter: resolving facts from YAML file "/opt/puppetlabs/facter/facts.d/test.yaml".ESC[0m
ESC[0;36mDebug: Facter: fact "one" has resolved to {
  ipam => {
    a => [
      "foo"
    ],
    cname => [
      "bar"
    ]
  }
}.ESC[0m

ESC[0;36mDebug: Facter: fact "two" has resolved to
{
  IPAM => {
    A => [
      "foo"
    ],
    CNAME => [
      "bar"
    ]
  }
}.ESC[0m{
code}

In facter 4, this fails:

 
{code:java}
// c:Error: Facter: Failed to handle /opt/puppetlabs/facter/facts.d/test.yaml as LegacyFacter::Util::Parser::YamlParser facts: Unknown alias: a1{code}

The expectation is that yaml anchors should function the same as they did in prior versions. Support has recommended their use on multiple prior occasions.

Nirupama Mantha (Jira)

unread,
Jul 12, 2022, 4:24:02 PM7/12/22
to puppe...@googlegroups.com

Nirupama Mantha (Jira)

unread,
Jul 12, 2022, 4:25:02 PM7/12/22
to puppe...@googlegroups.com
Nirupama Mantha updated an issue
Change By: Nirupama Mantha
Acceptance Criteria: Behavior is same as in Facter 3

Josh Cooper (Jira)

unread,
Jul 19, 2022, 10:18:03 PM7/19/22
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jul 25, 2022, 11:20:02 AM7/25/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Phoenix 2022-08-17
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Lisa Ross (Jira)

unread,
Aug 2, 2022, 10:59:03 AM8/2/22
to puppe...@googlegroups.com

Lisa Ross (Jira)

unread,
Aug 3, 2022, 8:40:03 AM8/3/22
to puppe...@googlegroups.com
Lisa Ross updated an issue
Change By: Lisa Ross
Epic Link: FACT-3139

Josh Cooper (Jira)

unread,
Aug 8, 2022, 8:27:01 PM8/8/22
to puppe...@googlegroups.com

Aria Li (Jira)

unread,
Aug 11, 2022, 4:47:01 PM8/11/22
to puppe...@googlegroups.com
Aria Li assigned an issue to Aria Li
 
Change By: Aria Li
Assignee: Aria Li

Christopher Thorn (Jira)

unread,
Aug 17, 2022, 12:13:02 PM8/17/22
to puppe...@googlegroups.com
Christopher Thorn updated an issue
Change By: Christopher Thorn
Sprint: Phoenix 2022-08-17 , Phoenix 2022-08-31

Michael Hashizume (Jira)

unread,
Sep 7, 2022, 4:49:03 PM9/7/22
to puppe...@googlegroups.com

Aria Li (Jira)

unread,
Sep 7, 2022, 7:34:03 PM9/7/22
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
Release Notes: Bug Fix

Aria Li (Jira)

unread,
Sep 7, 2022, 7:35:02 PM9/7/22
to puppe...@googlegroups.com
Aria Li updated an issue
Change By: Aria Li
Release Notes Summary: This change enabled YAML anchors in Facter 4, a feature that was available previously in Facter 3. Additionally, testing was added to ensure Facter continues to behave as expected when handling YAML anchors.

Parker Leach (Jira)

unread,
Sep 12, 2022, 12:46:03 PM9/12/22
to puppe...@googlegroups.com
Parker Leach updated an issue
Change By: Parker Leach
Labels: docs_reviewed jira_escalated
Reply all
Reply to author
Forward
0 new messages