Getting puppet bolt to work with facts

25 views
Skip to first unread message

Andy Hall

unread,
Aug 12, 2024, 7:06:27 AMAug 12
to Puppet Users
So I have a plan where I get facts...here is the relevant section...

  $target_facts = run_plan('facts', 'targets' => $targets)
  $target_facts.each |$result| {
  $target = $result['target']
  $targetfacts = $result['value']
  $os_release = $targetfacts['os']['release']['major']
  $kernel_version = $targetfacts['kernelrelease']

But I get this error...

  Evaluation Error: Operator '[]' is not applicable to an Undef Value.

This is referring to the following line which attempts to assign a fact...

  $os_release = $targetfacts['os']['release']['major']

Any ideas what I am doing wrong here ?

Thanks.
Reply all
Reply to author
Forward
0 new messages