Jira (FACT-1912) Should be possible to merge structured facts

1 view
Skip to first unread message

Matthias Baur (JIRA)

unread,
Mar 12, 2019, 4:28:02 AM3/12/19
to puppe...@googlegroups.com
Matthias Baur created an issue
 
Facter / New Feature FACT-1912
Should be possible to merge structured facts
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2019/03/12 1:27 AM
Priority: Normal Normal
Reporter: Matthias Baur

(Copied from https://projects.puppetlabs.com/issues/20408 originally created by Erik Dalén)

To be able to extend one structured fact with more data it should be possible to deep merge two facts.

For example it there was a “interfaces” hash containing network interfaces and info about them and you wanted to add LLDP information to them you could add another interfaces fact that would get deep merged with the original one.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Matthias Baur (JIRA)

unread,
Mar 12, 2019, 4:34:02 AM3/12/19
to puppe...@googlegroups.com
Matthias Baur commented on New Feature FACT-1912
 
Re: Should be possible to merge structured facts

This feature would allow a better name spacing of facts. Lets take the "apt" facts as an example:

root@test:/# facter -p | grep ^apt
apt_dist_updates => 3
apt_has_dist_updates => true
apt_has_updates => true
apt_package_dist_updates => [
apt_package_security_dist_updates => [
apt_package_security_updates => [
apt_package_updates => [
apt_reboot_required => false
apt_security_dist_updates => 3
apt_security_updates => 3
apt_update_last_success => 1552361391
apt_updates => 3

Those facts could be merge under an "apt" parent key:

root@test:/# facter -p
...
apt => {
  dist_updates                  => 3,
  has_dist_updates          => true,
  has_updates                 => true,
  package_dist_updates => [ ...],
...
}
...

The difference in Puppet code is:

Current way:

$foo = $facts['apt_dist_updates']
$bar = $facts['apt_reboot_required']

New way:

$foo = $facts['apt']['dist_updates']
$bar = $facts['apt']['reboot_required']

Geoff Nichols (JIRA)

unread,
Mar 27, 2019, 1:50:03 AM3/27/19
to puppe...@googlegroups.com
Geoff Nichols updated an issue
 
Change By: Geoff Nichols
Sprint: PR - Triage

Geoff Nichols (JIRA)

unread,
Mar 27, 2019, 1:50:03 AM3/27/19
to puppe...@googlegroups.com
Geoff Nichols updated an issue
Change By: Geoff Nichols
Team: Puppet Romania

Geoff Nichols (JIRA)

unread,
Mar 29, 2019, 4:19:04 AM3/29/19
to puppe...@googlegroups.com

Geoff Nichols (JIRA)

unread,
Mar 29, 2019, 4:20:03 AM3/29/19
to puppe...@googlegroups.com
Geoff Nichols updated an issue
Change By: Geoff Nichols
Sprint: PR - Triage

Mihai Buzgau (JIRA)

unread,
Apr 9, 2019, 11:07:03 AM4/9/19
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Team: Puppet Romania

Claudia Petty (Jira)

unread,
Jun 21, 2023, 8:43:04 AM6/21/23
to puppe...@googlegroups.com
Claudia Petty updated an issue
Change By: Claudia Petty
Labels: new-feature
This message was sent by Atlassian Jira (v8.20.21#820021-sha1:38274c8)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages