Can I add values to an existent core fact?

10 views
Skip to first unread message

Juan José Presa Rodal

unread,
Nov 26, 2015, 3:48:05 PM11/26/15
to Puppet Users
Hi, i would like to complete the disks fact with information about scsi port. So, I have this custom fact:


Facter.add(:disks, :type => :aggregate) do
  chunk(:scsiports) do
    disks = {}
    Facter.value(:disks).each do |disk, values|
      disks[disk] = {
        'scsiport' => Facter::Core::Execution.exec("find -L /dev/disk/by-path/ -samefile /dev/#{disk} | awk -F'[:.]' '{print $6}'"),
      }
    end
    disks
  end
end

But the result do not aggregate nothing to disks core fact. But if I change the name to one unused ie: Facter.add(:disks_custom) the output is correct:

facter -p disks_custom
 
{
  sda => {
    scsiport => "0"
  },
  sdb => {
    scsiport => "1"
  },
  sdc => {
    scsiport => "2"
  }
}

It is possible what I want to get? Or I need to make a full new fact with all the information.

Apologize my poor english and thanks in advance.
Reply all
Reply to author
Forward
0 new messages