@Martin,

I have tried your approach; I put the facter file underneath:
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/custom_facts/core/execution/

*file:*
username.rb

*content:*
*# username.rb*

*Facter.add(:username) do*
*  setcode do*
*    Facter::Core::Execution.execute("/usr/bin/hostname |/usr/bin/awk -F'-' 
{'print $1'}")*
*  end*
*end*

But I keep getting an error:
Error: Evaluation Error: Empty string title at 0. Title strings must have a 
length greater than zero. (line: 1, column: 8) on node 
puppet-master.domain.com

what am I missing here?
On Monday, December 5, 2022 at 10:02:09 AM UTC+2 Nir Fishler wrote:

> Thanks a lot guys for your prompt reply!
>
> Gonna try it out later on.
>
> On Monday, December 5, 2022 at 9:47:52 AM UTC+2 dhei...@opentext.com 
> wrote:
>
>> Am Sonntag, dem 04.12.2022 um 07:43 -0800 schrieb Nir Fishler:
>>
>> Main goal: get a list of upgrade-able packages and notify the user about 
>> it.
>>
>>
>> The puppetlabs-apt module from the Puppet Forge has various facts for 
>> this.
>>
>> HTH...
>>
>> Dirk
>>
>> -- 
>>
>> *Dirk Heinrichs*
>> Senior Systems Engineer, Delivery Pipeline
>> OpenText ™ Discovery | Recommind
>> *Phone*: +49 2226 15966 18 <+49%202226%201596618>
>> *Email*: dhei...@opentext.com
>> *Website*: www.recommind.de
>> Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
>> Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, 
>> Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
>> This e-mail may contain confidential and/or privileged information. If 
>> you are not the intended recipient (or have received this e-mail in error) 
>> please notify the sender immediately and destroy this e-mail. Any 
>> unauthorized copying, disclosure or distribution of the material in this 
>> e-mail is strictly forbidden
>> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte 
>> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail 
>> irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und 
>> vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte 
>> Weitergabe dieser Mail sind nicht gestattet.
>>
>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/703212ce-9dd7-426a-bb8d-20a0058fc3f1n%40googlegroups.com.

Reply via email to