Ask Your Question
0

Ruby code separate from Facter facts.

asked 2016-05-14 22:30:22 -0500

DarylW gravatar image

I saw that when working with custom Types/Providers, it is recommended to put your custom ruby code in a puppetx directory as to prevent overlapping with code in the puppet namespace. However, when trying to apply the same principal to facter facts, it does not appear that they have access to the puppetx lib directory when they are syncronized to the agent machine!

I was looking at how rtyler-jenkins module does the separation. Is my only option to add a folder namespaced under the puppet folder (in the jenkins example, lib/puppet/jenkins/facts)? Are there any guides on getting started writing tests for your broken out ruby code? I'm still new to ruby, and ran into some issues moving beyond my regular rspec-puppet based tests.

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-05-16 08:19:00 -0500

The standard for libraries in fact development is to use a util directory.

See for example https://github.com/camptocamp/puppet-...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2016-05-14 22:30:22 -0500

Seen: 278 times

Last updated: May 16 '16