I tried this method too:
http://www.puppetcookbook.com/posts/override-a-facter-fact.html
It works with puppet 2.7, but not with 2.6.2
[16:41:15 #168 root@:~$ ] FACTER_operatingsystem=plop puppet -e 'notify {
> "We are running on $::operatingsystem": }'
> notice: We are running on Debian
> notice: /Stage[main]//Notify[We are running on Debian]/message: defined
> 'message' as 'We are running on Debian'
> [16:41:32 #169 root@:~$ ] puppetd --version
> 2.6.2
> [16:41:35 #170 root@:~$ ] puppet agent --version
> 2.6.2
Le mardi 17 juillet 2012 15:30:15 UTC+2, julien cosmao a écrit :
>
> Hi,
>
> I want to add "Proxmox" as new value in $::operatingsystem.
> "Proxmox" is based on Debian, so the normal value is currently "Debian".
>
> To change that, I just write a custom fact based on the facter fact
> "operatingsystem"
>
> Facter.add(:operatingsystem) do
>> ...
>> setcode do
>> ...
>> elsif FileTest.exists?("/usr/bin/pveversion")
>> "Proxmox"
>
>
> This method doesn't override the original fact.
>
> I've also tried to set $::operatingsystem = "Proxmox" directly in my node.
>
> What's the best way to do override an existing fact ?
>
> Regards,
>
> Julien
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/Iwk2fRGZe-sJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.