Jira (PUP-11662) Allow legacy facts to be excluded

31 views
Skip to first unread message

Josh Cooper (Jira)

unread,
Oct 20, 2022, 7:08:03 PM10/20/22
to puppe...@googlegroups.com
Josh Cooper created an issue
 
Puppet / Improvement PUP-11662
Allow legacy facts to be excluded
Issue Type: Improvement Improvement
Assignee: Unassigned
Created: 2022/10/20 4:07 PM
Priority: Normal Normal
Reporter: Josh Cooper

Puppet agents send core facts to puppetserver in two forms (legacy and structured). In a default agent install, legacy facts account for 25% of the overall fact data when serialized on the wire. The actual savings depends on the number of mountpoints, network interfaces and processors, since facter adds one legacy fact per instance.

And legacy facts cause problems for puppetserver when using ERB templates because of the way top-scope variables are bound to instance variables in the scope. See PUP-9577

Most of the puppet ecosystem has moved to structured facts, for example, there is a puppet-lint plugin to find and correct legacy fact usage in puppet code: https://github.com/mmckinst/puppet-lint-legacy_facts-check

This ticket is to allow the agent to exclude legacy facts that it sends to puppetserver. The default behavior should remain the same in 7.x and in 8.0 we can exclude legacy facts by default (see PUP-11430).

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Josh Cooper (Jira)

unread,
Oct 20, 2022, 7:43:02 PM10/20/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Puppet agents send core facts to puppetserver in two forms (legacy and structured). In a default agent install, legacy facts account for 25% of the overall fact data when serialized on the wire. The actual savings depends on the number of mountpoints processors , block devices and network interfaces and processors , since because facter adds one multiple legacy fact facts per instance :

{noformat}
blockdevice_sda_model =>
. ..
blockdevice_sda_size => 1024209543168
blockdevice_sda_vendor => ...
...
processor0 => 11th Gen ...
processor1 => 11th Gen ...
...
processorN => 11th Gen ...
...
ipaddress6_lo => ::1
ipaddress_lo => 127.0.0.1
mtu_lo => 65536
netmask6_lo => ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
netmask_lo => 255.0.0.0
network6_lo => ::1
network_lo => 127.0.0.0
scope6_lo => host
{noformat}


And legacy facts cause problems for puppetserver when using ERB templates because of the way top-scope variables are bound to instance variables in the scope. See PUP-9577

Most of the puppet ecosystem has moved to structured facts, for example, there is a puppet-lint plugin to find and correct legacy fact usage in puppet code modules : https://github.com/mmckinst/puppet-lint-legacy_facts-check

While it's possible to block legacy facts (using facter's block list) it puts the burden on users to make that change.

This ticket is to allow the agent to exclude legacy facts that it sends to puppetserver. The default behavior should remain the same in 7.x and in 8.0 we can exclude legacy facts by default (see PUP-11430).

Josh Cooper (Jira)

unread,
Oct 24, 2022, 2:06:01 PM10/24/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.21.0

Josh Cooper (Jira)

unread,
Oct 24, 2022, 2:08:03 PM10/24/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Epic Link: PUP-11619

Josh Cooper (Jira)

unread,
Oct 25, 2022, 12:52:03 PM10/25/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.21.0

Morgan Rhodes (Jira)

unread,
Oct 25, 2022, 4:32:01 PM10/25/22
to puppe...@googlegroups.com
Morgan Rhodes updated an issue
Change By: Morgan Rhodes
Sprint: Phoenix 2022-11-09

Morgan Rhodes (Jira)

unread,
Oct 25, 2022, 4:32:02 PM10/25/22
to puppe...@googlegroups.com
Morgan Rhodes updated an issue
Change By: Morgan Rhodes
Fix Version/s: PUP 7.21.0

Josh Cooper (Jira)

unread,
Oct 26, 2022, 1:52:02 AM10/26/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Enhancement
Release Notes Summary: Adds a puppet setting "include_legacy_facts" to control whether legacy facts are sent to puppetserver when requesting a catalog. By default, puppet continues to send legacy facts, but it can be disabled provided all puppet manifests, hiera.yaml and hiera configuration layers have been modified to no longer use legacy facts.

Josh Cooper (Jira)

unread,
Oct 26, 2022, 2:32:04 AM10/26/22
to puppe...@googlegroups.com
Josh Cooper assigned an issue to Josh Cooper
Change By: Josh Cooper
Assignee: Josh Cooper

Morgan Rhodes (Jira)

unread,
Oct 26, 2022, 1:26:03 PM10/26/22
to puppe...@googlegroups.com
Morgan Rhodes updated an issue
Change By: Morgan Rhodes
Story Points: 2

Josh Cooper (Jira)

unread,
Oct 27, 2022, 11:53:04 AM10/27/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Acceptance Criteria: By default there should be no change in how the agent collects or sends facts (legacy, core, external or custom)

If legacy facts are disabled, then the agent should not send legacy facts. However, types and providers that confine or set defaultsfor based on legacy facts should still work. Also custom and external facts should continue to be sent.

Josh Cooper (Jira)

unread,
Oct 31, 2022, 12:29:03 PM10/31/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Puppet agents send core facts to puppetserver in two forms (legacy and structured). In a default agent install, legacy facts account for 25% of the overall fact data when serialized on the wire. The actual savings depends on the number of processors, block devices and network interfaces, because facter adds multiple legacy facts per instance:


{noformat}
blockdevice_sda_model => ...
blockdevice_sda_size => 1024209543168
blockdevice_sda_vendor => ...
...
processor0 => 11th Gen ...
processor1 => 11th Gen ...
...
processorN => 11th Gen ...
...
ipaddress6_lo => ::1
ipaddress_lo => 127.0.0.1
mtu_lo => 65536
netmask6_lo => ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
netmask_lo => 255.0.0.0
network6_lo => ::1
network_lo => 127.0.0.0
scope6_lo => host
{noformat}


And legacy facts cause problems for puppetserver when using ERB templates because of the way top-scope variables are bound to instance variables in the scope. See PUP-9577

Most of the puppet ecosystem has moved to structured facts, for example, there is a puppet-lint plugin to find and correct legacy fact usage in puppet modules: https://github.com/mmckinst/puppet-lint-legacy_facts-check

While it's possible to block legacy facts (using facter's block list)
it puts the burden , doing so breaks puppet's builtin providers, as they rely on users to make that change. legacy facts for confining and defaulting providers, see PUP-11430

This ticket is to allow the agent to exclude legacy facts that it sends to puppetserver. The default behavior should remain the same in 7.x and in 8.0 we can exclude legacy facts by default (see PUP-11430).

Tony Vu (Jira)

unread,
Nov 1, 2022, 12:08:02 PM11/1/22
to puppe...@googlegroups.com
Tony Vu assigned an issue to Tony Vu
Change By: Tony Vu
Assignee: Tony Vu

Tony Vu (Jira)

unread,
Nov 1, 2022, 12:08:02 PM11/1/22
to puppe...@googlegroups.com
Tony Vu assigned an issue to Unassigned
Change By: Tony Vu
Assignee: Josh Cooper

Tony Vu (Jira)

unread,
Nov 2, 2022, 2:44:03 PM11/2/22
to puppe...@googlegroups.com
Tony Vu assigned an issue to Unassigned
Change By: Tony Vu
Assignee: Tony Vu

Morgan Rhodes (Jira)

unread,
Nov 9, 2022, 1:06:02 PM11/9/22
to puppe...@googlegroups.com
Morgan Rhodes updated an issue
Change By: Morgan Rhodes
Sprint: Phoenix 2022-11-09 , Phoenix 2022-11-23

Josh Cooper (Jira)

unread,
Nov 22, 2022, 1:24:02 PM11/22/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Acceptance Criteria:
By default there should be no change in how the agent collects or sends facts (legacy, core, external or custom)

If legacy facts are disabled, via include_legacy_facts=false or --no-include_legacy_facts, then the agent should not send legacy facts. However, types and providers that confine or set defaultsfor based on legacy facts should still work. Also custom and external facts should continue to be sent.

Parker Leach (Jira)

unread,
Dec 7, 2022, 4:14:03 PM12/7/22
to puppe...@googlegroups.com
Parker Leach updated an issue
Change By: Parker Leach
Labels: docs_reviewed
Reply all
Reply to author
Forward
0 new messages