1 Feb 2007, 18:40
Tags:
Comments Off

Puppet, debian and update-alternatives

One way to solve it would be:

define check_alternatives($linkto) {
  exec { "/usr/sbin/update-alternatives --set $name $linkto":
    unless => "/bin/sh -c '[ -L /etc/alternatives/$name ] && [ /etc/alternatives/$name -ef $linkto ]'"
  }
}

Use it as:

# We want to use pinfo as infobrowser
check_alternatives { "infobrowser":
  linkto => "/usr/bin/pinfo"
}

Can probably be done better, but this works for me :)

Tags:

 
  • Calender

    February 2007
    M T W T F S S
    « Jan   Mar »
     1234
    567891011
    12131415161718
    19202122232425
    262728  
  • Twitter

    Powered by Twitter Tools

  • RSS Delicious feed

  • Archives