Hey Scott, You probably want to reference a Fact, whether custom or not. Check `puppet facts find $(hostname)` to see what facts are available on your systems. If you don't find on you like, you may have to write one following this guide <https://docs.puppet.com/facter/3.4/custom_facts.html>. It should be fairly easy to make a dmidecode fact if there isn't one already.
Good luck, Nick On Mon, Sep 26, 2016 at 6:09 PM, Scott Walker <[email protected]> wrote: > I'm relatively new to puppet (came from chef world). > > I'm trying to figure out a way to cleanly do the following... > > On machines which /usr/sbin/dmidecode | grep Z640 (this is how we are sure > the machine is Z640 and not some other type of machine) return true I want > to do the following: > > file { '/etc/default/grub': > path => '/etc/default/grub' > ensure => present, > mode => '0644', > owner => 'root', > group => 'root', > notify => Exec['grub-update'], > source => 'puppet:///modules/z640/grub' > } > > exec { 'grub-update': > refreshonly => true, > command => '/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg', > } > > Otherwise I don't want to do anything. (This is to help fix an NVME issue > I am having on 60+ workstation out of 700 in the studio. > > I just can't wrap my head around a clean way to achieve this goal. > > I know this is probably a really simple task I just need some direction.... > > -- > 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/024553d2-1872-4eab-9bd5-8280c92c07ec%40googlegroups.com > <https://groups.google.com/d/msgid/puppet-users/024553d2-1872-4eab-9bd5-8280c92c07ec%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- [image: OnyxPoint-logo-symbol-primary.png] Nicholas Miller Consultant | Onyx Point, Inc. 7050 Hi Tech Drive, Suite 102 Hanover, MD. 21076 e: [email protected] w: 443-655-3675 [image: copmany.png][image: careers.png][image: product.png][image: meetups.png][image: blog.png] -- 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/CAHY4EYPHQovRLxXzm9iL4kdhrXVvkypQ5XTH2wSryZmtY7tAtw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
