1 define site::alternative ($linkto, $ensure = present) {
4 if $::lsbdistcodename == 'lenny' {
5 exec { "/usr/sbin/update-alternatives --set ${name} ${linkto}":
6 unless => "[ $(readlink -f /etc/alternatives/${name}) = ${linkto} ]",
9 exec { "/usr/sbin/update-alternatives --set ${name} ${linkto}":
10 unless => "[ $(update-alternatives --query ${name} | grep ^Value | awk '{print \$2}') = ${linkto} ]",
15 if $::lsbdistcodename == 'lenny' {
16 exec { "/usr/sbin/update-alternatives --remove ${name} ${linkto}":
17 unless => "[ $(readlink -f /etc/alternatives/${name}) != ${linkto} ]",
20 exec { "/usr/sbin/update-alternatives --remove ${name} ${linkto}":
21 unless => "[ $(update-alternatives --query ${name} | grep ^Value | awk '{print \$2}') != ${linkto} ]",
25 default: { fail ( "Unknown ensure value: '$ensure'" ) }