Legacy facts are no longer collected on Puppet agent or sent to Puppet
server. This saves network bandwidth and reduces Puppetserver's memory
footprint when using templates.
Since legacy facts are not available during compilation, they cannot be
referenced in Puppet code, ERB/EPP templates or Hiera configuration. The
legacy_facts puppet-lint plugin can help identify and automatically
correct legacy fact usage in Puppet code. For more information visit
https://github.com/puppetlabs/puppet-lint/blob/main/lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb.
Legacy facts can be re-enabled by setting include_legacy_facts=true in
puppet.conf on each agent. PUP-11430
Evaluation
We can utilize the puppet-lint plugin to automatically replace legacy
facts with equivalent structured facts. However, all the remaining
legacy facts will require us to read the code and craft an appropriate
patch. We should be able to test this with PCC after writing code to
strip legacy facts out of our exported fact data.
- convertible facts in our code, about 500 lines
- run puppet-lint plugin, puppet-lint --only-checks legacy_facts modules --fix
- carve out commits, or possibly one giant commit?
- convertible facts in vendored code
- rspamd: upgrade to upstream branch https://github.com/markt-de/puppet-rspamd
- unconvertible facts in our code
- interfaces
- modules/interface/manifests/add_ip6_mapped.pp:15
- memorysize_mb
- modules/osm/manifests/osm2pgsql.pp:11
- modules/osm/manifests/planet_sync.pp:81
- modules/profile/manifests/hadoop/common.pp:248
- modules/role/manifests/redis/misc/master.pp:6
- modules/role/manifests/redis/misc/slave.pp:6
- modules/vm/manifests/min_free_kbytes.pp:8
- modules/vm/manifests/min_free_kbytes.pp:25
- interfaces
- Disable legacy facts in puppet 7