[Puppet Users] Re: Is this a Facter 4 bug? (using custom facts in other custom facts.)
The cause for your issues is that there's code before the setcode do line, which will cause issues under Facter 4. Having code before setcode do was a bad coding practice but didn't break things in Facter 3. In Facter 4, it does break things. If you move the hostname=Facter.value(:networking)['hostname'] statement to below setcode do, everything should be fine. Kind regards, Kevin On Thursday, January 20, 2022 at 7:09:34 PM UTC+1 mark...@gmail.com wrote: > Upgrade from facter 3.11.14 to 4.2.5 (puppet-agent 5 to 7) broke some of > our custom facts, that use other (custom) facts. > Managed to find the smallest examples of two custom facts that reproduce > the problem. > > First fact, that uses a core fact: > > Facter.add(:my_fact) do > hostname=Facter.value(:networking)['hostname'] > setcode do > hostname > end > end > > Second fact, that uses the first fact: > > my_fact = Facter.value(:my_fact) > Facter.add(:my_new_fact) do > setcode do > my_fact > end > end > > The first fact works, it's the second one that stops working with > puppet7/facter4. > > puppet5/facter3: > amvdi-it133:~# facter -p my_fact my_new_fact > my_fact => amvdi-it133 > my_new_fact => amvdi-it133 > > puppet7/facter4: > mvdi-it133:~# facter -p my_fact my_new_fact > my_fact => amvdi-it133 > my_new_fact => > > Seems to have to do with calling Facter.vaiue in the first fact. > This still does not work: > > Facter.add(:my_fact) do > unused=Facter.value(:networking)['hostname'] > hostname="testing" > setcode do > ... > > But this does: > > Facter.add(:my_fact) do > hostname="testing" > setcode do > ... > > # facter -p my_fact my_new_fact > my_fact => testing > my_new_fact => testing > > Also found that it works if I change the second fact to do the > Facter.value inside the setcode block: > > Facter.add(:my_new_fact) do > setcode do > my_fact = Facter.value(:my_fact) > my_fact > end > end > > Learning this I went back to the first fact and changed it to do the > Facter.value inside the setcode block too like this: > > Facter.add(:my_fact) do > setcode do > hostname=Facter.value(:networking)['hostname'] > hostname > end > end > > That also makes it work regardless of where I do Facter.value in the > second fact. > > I'm at a loss as to what the fact is going on here. Is it a bug? Or is > there a reasonable explanation for it? (I'm a complete Ruby noob, ) > > Regards, > Mark. > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/187eda21-5319-42d9-9e82-a820e05a3670n%40googlegroups.com.
[Puppet Users] Puppet Platform 6.26.0 is now available
The release contains new features, minor enhancements, and bug fixes including: Agent 6.26.0 - Changed the priority of the --environment option by skipping the classification whenever the flag is specified. This allows the user to bypass the ENC enforced environment with the CLI option. - Added support for Red Hat Enterprise Linux (RHEL) 9. - Added support for Windows Server 2022(x86_64). PuppetDB 6.20.0 - Added an optimization to improve the performance of the inventory endpoint when filtering on a trusted fact. Server 6.18.0 - Users can now enable module metrics collection via Dropsonde. To turn this on, configure dropsonde: { enabled: true } in puppetserver.conf. By default when enabled, Dropsonde collects metrics when the service is started and once a week thereafter. For the full list of changes, check out the release notes: https://puppet.com/docs/puppet/6/release_notes_osp.html -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CABRr%2BmKrNEDngicYhyPfjLN0334n74xhb0xAuBvu7b_RvDyAmQ%40mail.gmail.com.
[Puppet Users] Puppet Platform 7.14.0 is now available
The next release in the Puppet 7 series, Puppet 7.14.0, is now available! The release contains enhancements and vulnerability fixes, including: Agent 7.14.0 - Support for RHEL 9. - Upgraded Ruby component to 2.7.5. Server 7.6.0 - Puppet Server is now packaged for Debian 11. It requires Java 11 to be installed. PuppetDB 7.9.0 - Added support for Debian 11.I - Improved performance of the "deactivate node" command. - Improved performance of the fact-contents endpoint. Testing against a database of 10,000 mocked nodes, there was an observed 84% decrease in time taken to complete a difficult query. For the full list of changes, check out the release notes: https://puppet.com/docs/puppet/7/release_notes_osp.html -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CABRr%2BmJZ7-vsCbJFxYBrShbpXhKPn-HWPK8N-Yv%2Bvk%3DSzVL7Dg%40mail.gmail.com.
[Puppet Users] Puppet Platform 7.14.0 is now available
The next release in the Puppet 7 series, Puppet 7.14.0, is now available! The release contains enhancements and vulnerability fixes, including: Agent 7.14.0 - Added support for trusted facts with the puppet lookup command - Added support for Red Hat Enterprise Linux 9 Beta (x86_64) - Upgraded Ruby component to 2.7.5. - PuppetDB 7.9.0 - Added support for Debian 11.I - Improved performance of the "deactivate node" command. - Improved performance of the fact-contents endpoint. Testing against a database of 10,000 mocked nodes, there was an observed 84% decrease in time taken to complete a difficult query. Server 7.6.0 - Puppet Server is now packaged for Debian 11. It requires Java 11 to be installed. For the full list of changes, check out the release notes: https://puppet.com/docs/puppet/7/release_notes_osp.html -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CABRr%2BmKaL3nJ8U-VbV5RWkWr_8wL%2Bs3nCMt-Eh%2BYxKT3kVcVqQ%40mail.gmail.com.
[Puppet Users] Puppet Platform 6.26.0 is now available
The release contains new features, minor enhancements, and bug fixes including: Agent 6.26.0 - Support for trusted facts with the puppet lookup command - Added support for Red Hat Enterprise Linux 9 Beta (x86_64) - Added support for Windows Server 2022(x86_64). PuppetDB 6.20.0 - Added an optimization to improve the performance of the inventory endpoint when filtering on a trusted fact. Server 6.18.0 - Users can now enable module metrics collection via Dropsonde. To turn this on, configure dropsonde: { enabled: true } in puppetserver.conf. By default when enabled, Dropsonde collects metrics when the service is started and once a week thereafter. For the full list of changes, check out the release notes: https://puppet.com/docs/puppet/6/release_notes_osp.html -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CABRr%2Bm%2BZeM5F0o-RbFZuxeZPGHe5ZYTfmpPg8kSNo%2B%3D2OX7Mfw%40mail.gmail.com.