소스 검색

Added some crazy bash madness to check if the ppa is installed already. Otherwise the manifest tries to add it on every run!

Robert Navarro 12 년 전
부모
커밋
1af9a13
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      manifests/ppa.pp

+ 4 - 0
manifests/ppa.pp

@@ -4,6 +4,10 @@ define apt::ppa() {
 
   Class['apt'] -> Apt::Ppa[$title]
 
+  Exec {
+    onlyif => "/usr/bin/test ! $(/bin/ls /etc/apt/sources.list.d | /bin/grep -v $(echo \"${title}\" | /usr/bin/gawk 'match(\$0, /^ppa:(.*)\/(.*)$/, vals) {printf \"%s-%s\", vals[1], vals[2]}'))",
+  }
+
   exec { "apt-update-${name}":
     command     => "/usr/bin/aptitude update",
     refreshonly => true,