0

novice question here. I know it is similar to others here but i am not finding i can apply those answers in my case

i have 2 servers that are blades and 2 that are regular rack mount servers. a puppet script runs on all 4. i want to set a specific value in $sriov_device if the script is running on a blade, but not the other servers.

the blades both have a /usr/local/blade file existing

in a manifest script am trying something like this, but $sriov_device is not being set

file { "/usr/local/blade":
  ensure => present,
  replace => false,
}

whatever {"foo":
  $sriov_device = "eno2"
  require => File["/usr/local/blade"],
}

thanks, sincerely,

-- novice

jodlgc
  • 25

1 Answers1

0

This worked for me:

if ($type == 'Blade') { 
 $sriov_device = "eno2" 
} else {
 $sriov_device = "None" 
}

I was trying to use if ($facts[Type] == "Blade", but I kept getting the error that "Facts was not a hash or array", so then I tried the above which uses the classic facts which just uses the fact name $type.

Picachieu
  • 111
jodlgc
  • 25