Is it possible (and how?) to reference a variable from within a custom fact?
I need to write a simple custom fact that tests whether a document container can be opened with the LUKS key available to the system or not. The location for the key is system-dependent, and is managed by the puppet itself.
I need to write something like this:
Facter.add(:docexists) do setcode do if `cryptsetup luksOpen --key-file $MyDocsCryptKeyFile $MyDocsCryptFile $MyDocsCryptMapperName` true else false end end end
Unfortunately I know almost nothing of Ruby. Can anyone point me, how to reference the variables (not environment variables) from within Puppet's cutstom fact?