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

Feature/update legacy facts #112

Merged
merged 3 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: use os fact
  • Loading branch information
fb-tricent committed Oct 13, 2023
commit 831a4f3f0a5874e7377aafa259bcd91c2f2c6092
14 changes: 8 additions & 6 deletions lib/puppet/parser/functions/tp_lookup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ module Puppet::Parser::Functions
repo = ''
end

os = lookupvar("::os")

model = {
:title => app,
:osfamily => Facter.value('os')['family'],
:operatingsystem => Facter.value('os')['name'],
:operatingsystemmajrelease => Facter.value('os')['release']['major'],
:operatingsystemrelease => Facter.value('os')['release']['full'],
:repo => repo,
:title => app,
:osfamily => os['family'],
:operatingsystem => os['name'],
:operatingsystemmajrelease => os['release']['major'],
:operatingsystemrelease => os['release']['full'],
:repo => repo,
}

hiera[:hierarchy].reverse!.each { | p |
Expand Down
14 changes: 8 additions & 6 deletions lib/puppet/parser/functions/tp_lookup4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ module Puppet::Parser::Functions
repo = ''
end

os = lookupvar("::os")

model = {
:title => app,
:osfamily => Facter.value('os')['family'],
:operatingsystem => Facter.value('os')['name'],
:operatingsystemmajrelease => Facter.value('os')['release']['major'],
:operatingsystemrelease => Facter.value('os')['release']['full'],
:repo => repo,
:title => app,
:osfamily => os['family'],
:operatingsystem => os['name'],
:operatingsystemmajrelease => os['release']['major'],
:operatingsystemrelease => os['release']['full'],
:repo => repo,
}

hiera[:hierarchy].reverse!.each { | p |
Expand Down
Loading