Am 10.01.2022 um 18:07 schrieb Karsten Heymann:
Hi Helmut,
you could take this as a starting point (untested):

$profile_logging = $profiles.map | $p_name, $p_data | { $p_data.map | $s_name, $s_data | { $s_data['syslog'] } }.flatten

p_ is the outer profile layer, s_ is the inner service layer.

$array = keys($profiles).map |$ca_index, $category| {
  keys($profiles[$category]).map |$a_index, $app| {
    keys($profiles[$category][$app]).map |$co_index, $config| {
      if $config == "syslogd" {
        keys($profiles[$category][$app][$config]).map |$f_index, $file| {
keys($profiles[$category][$app][$config][$file]).map |$p_prog, $prog| {
            $prog
          }
        }
      }
    }
  }
}.flatten

$profile_logging = $array.filter |$index, $entry| {
  $entry =~ NotUndef
}

notify {"profile_logging: $profile_logging":}



Maybe not best code style but works. Thank you!

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/srmrl4%24tk0%241%40ciao.gmane.io.

Reply via email to