Hi, I''ve got a question regarding a fact. I''m trying to use the ''is_virtual'' fact in a class manifest: class io_scheduler { if $is_virtual { file { "/etc/default/grub": owner => "root", group => "root", mode => 0644, source => "puppet:///modules/io_scheduler/etc/default/grub", } } } However, on one of my physical systems: $ facter | grep is_virtual is_virtual => false The file mentioned above gets installed: Nov 23 14:22:50 hostname puppet-agent[1838]: (/Stage[main]/Io_scheduler::Config/File[/etc/default/grub]/content) content changed ''{md5}01de0bd1b00e2ca04ebb873ace6f20fe'' to ''{md5}a882618adcb31667cbab22731f8f16e2'' Any ideas what is wrong here? Thanks for the help! -matt zagrabelny -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 2011-11-23 12:49 , Matt Zagrabelny wrote:> Hi, > > I''ve got a question regarding a fact. I''m trying to use the > ''is_virtual'' fact in a class manifest: > > class io_scheduler { > if $is_virtual { > file { "/etc/default/grub": > owner => "root", > group => "root", > mode => 0644, > source => "puppet:///modules/io_scheduler/etc/default/grub", > } > } > } > > However, on one of my physical systems: > > $ facter | grep is_virtual > is_virtual => false > > The file mentioned above gets installed: > > Nov 23 14:22:50 hostname puppet-agent[1838]: > (/Stage[main]/Io_scheduler::Config/File[/etc/default/grub]/content) > content changed ''{md5}01de0bd1b00e2ca04ebb873ace6f20fe'' to > ''{md5}a882618adcb31667cbab22731f8f16e2'' > > Any ideas what is wrong here? > > Thanks for the help! > > -matt zagrabelny >Facter facts are all strings, not true booleans. You''ll need to check for whether or not $is_virtual == ''true''. -- Jacob Helwig http://about.me/jhelwig
> Facter facts are all strings, not true booleans. You''ll need to check > for whether or not $is_virtual == ''true''.Thanks for the prompt reply, Jacob! Things look good now. -mz -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.