1 define site::alternative ($linkto, $ensure = present) {
4 exec { "/usr/bin/update-alternatives --set ${name} ${linkto}":
5 unless => "[ $(update-alternatives --query ${name} | grep ^Value | awk '{print \$2}') = ${linkto} ]",
9 exec { "/usr/bin/update-alternatives --remove ${name} ${linkto}":
10 unless => "[ $(update-alternatives --query ${name} | grep ^Value | awk '{print \$2}') != ${linkto} ]",
13 default: { fail ( "Unknown ensure value: '$ensure'" ) }