Am 10.01.2022 um 15:55 schrieb 'Dirk Heinrichs' via Puppet Users:
> Am Montag, dem 10.01.2022 um 14:29 +0100 schrieb Helmut Schneider:
>
>> I'm afraid I still do not unterstand this correctly:
>>
>> profiles:
>>    vpn:
>>      openvpn:
>>        syslogd:
>>          40-openvpn.conf:
>>            openvpn:
>>              '*.*':                          '/var/log/openvpn.log'
>>
>> $array = [1].map |$var| {
>>    keys($profiles).each |$category| {
>>      if $profiles[$category] =~ Hash {
>>        keys($profiles[$category]).each |$app| {
>>          "$app"
>>        }
>>      }
>>    }
>> }
>
> Not 100% sure this will be correct, since your "profiles" sample above
> has only one entry, but anyway...
>
> I guess what you'd need to do is
>
> $array = $profiles.map |...| {
>    ...
> }

Well, yes, it outputs "openvpn" now but at the end of the day I hoped to get the "openvpn" key from "40-openvpn.conf" and not from "vpn".

profiles:
  vpn:
    openvpn:
      syslogd:
        40-openvpn.conf:
          openvpn:
            '*.*':                          '/var/log/openvpn.log'
  backup:
    bacula:
      syslogd:
        40-bacula.conf:
          bacula-dir:
            '*.*':                     '/var/log/bacula-dir.log'
          bacula-fd:
            '*.*':                     '/var/log/bacula-fd.log'
          bacula-sd:
            '*.*':                     '/var/log/bacula-sd.log'
  management:
    snmpd:
      syslogd:
        40-snmpd.conf:
          snmpd:
            '*.*':        '/var/log/snmpd.log'

I'm looking for a way to get the information of $profiles.*.*.syslogd or better $profiles.*.*.syslogd.*. So "openvpn", "bacula-dir", "bacula-fd", ... into an array / hash / whatever.

--
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/srhnl8%24nf4%241%40ciao.gmane.io.

Reply via email to