Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom facts examples use legacy facts #1155

Closed
spotter-puppet opened this issue Jun 5, 2024 · 2 comments
Closed

Custom facts examples use legacy facts #1155

spotter-puppet opened this issue Jun 5, 2024 · 2 comments
Labels
triaged This ticket has been accepted to our backlog and migrated internally

Comments

@spotter-puppet
Copy link

One of the examples in https://www.puppet.com/docs/puppet/8/fact_overview.html#writing_facts_simple_resolutions-examples refers to osfamily, a legacy fact. The sample code should be changed from

Facter.add(:rubypath) do
  setcode 'which ruby'
end

Facter.add(:rubypath) do
  confine osfamily: "Windows"
  # Windows uses 'where' instead of 'which'
  setcode 'where ruby'
end

to something like

Facter.add(:rubypath) do
  setcode 'which ruby'
end

Facter.add(:rubypath) do
  confine 'os' do |os_fact|
    os_fact['family'] == "Windows"
  end
  # Windows uses 'where' instead of 'which'
  setcode 'where ruby'
end
@IngridaCazers IngridaCazers added the triaged This ticket has been accepted to our backlog and migrated internally label Jun 10, 2024
Copy link

Migrated issue to PUPDOC-5654

@IngridaCazers
Copy link
Contributor

This issue was addressed and the update will be published in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged This ticket has been accepted to our backlog and migrated internally
Projects
None yet
Development

No branches or pull requests

2 participants