IF Distro Check: Ubuntu 16 or 17

13 views
Skip to first unread message

matt...@gmail.com

unread,
Nov 23, 2017, 10:33:47 AM11/23/17
to Puppet Users
Hi, i want to check (puppet facts / facter: is there a difference?) which version is installed on the machine (we use Ubuntu 16 for older and Ubuntu 17 for newer laptops, they have different WLAN Modules) . Can you please support me with the correct "Mayor-Distro-Check" ? 

It doesnt work like that:


  if $facts['os id'] == 'Ubuntu' {
    if $facts['os major'] == '16.04.' {
        $ubunutname = 'xenial'
        $wlankarte  = 'wlp4s0'
        
    }
    if $facts['os major'] == '17.04' {
      $ubunutname = 'zesty'
      $wlankarte  = 'wlp58s0'
    }
    else{
      fail("Unsupported major of ${facts}['operatingsystem']")
    }
  }
Reply all
Reply to author
Forward
0 new messages