Skip to content

Puppet 8 compatibility - Replace legacy facts in chocolatey custom fact confines #374

Description

@chambersmp

Describe the Bug

Legacy facts present in the confine statement for custom facts. These are not compatible with Puppet 8 default setting to disable legacy fact collection.

Facter.add('choco_install_path') do
confine osfamily: :windows
setcode do
PuppetX::Chocolatey::ChocolateyInstall.install_path || 'C:\ProgramData\chocolatey'
end
end

Facter.add('choco_temp_dir') do
confine osfamily: :windows
setcode do
PuppetX::Chocolatey::ChocolateyInstall.temp_dir || ENV.fetch('TEMP', nil)
end
end

Facter.add('chocolateyversion') do
confine osfamily: :windows
setcode do
choco_ver = PuppetX::Chocolatey::ChocolateyVersion.version || '0'
choco_ver.to_s
end
end

Expected Behavior

Please update to the structured fact 'os.family' for Puppet 7 and 8 compatibility.

confine 'os.family': :windows

Should you wish to maintain backwards compatibility with Puppet 6, consider using a Ruby block.

confine 'os' do | os |
  os['family'] == 'windows'
end

Additional Context

Reference:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions