Hello everybody,
i’m trying to write a custom fact, which shows the scsi-id for a disk. But Foreman (version 2.0.0) seems to convert the scsi-id string to int (“0:0:1:0” -> 1).
What can i do so that foreman does not convert the string to an int?
The output of facter(version: 3.14.12 ) looks like:
I wonder if this is a problem in the YAML conversion somewhere. If you look what’s in /opt/puppetlabs/server/data/puppetserver/yaml/node, is it quoted?
My theory is that Ruby 2.5 as part of Puppet 6 it uses YAML 1.2 and doesn’t quote it. Then the Foreman ENC script uses Ruby 2.0 which uses an older YAML spec that still support sexagesimal numbers (see https://yaml.org/spec/1.1/#id858600).
The SCSI IDs do not match the regex so they’re not replaced. As a workaround you can also change the shebang to a newer Ruby version, like /usr/bin/tfm-ruby or /opt/puppetlabs/puppet/bin/ruby.