Linux

puppet 環境變數 $PATH 未設置

  • March 8, 2013

我正在嘗試在 Debian 6.0 上安裝帶有 puppet 2.7 的模組,但我不斷收到此錯誤:

returns: change from notrun to 0 failed: Could not find command 'tar'

這是相關程式碼:

file {"zookeeper-tarball":
   path => "${zookeeper_parent_dir}/${tarball}",
   source => "puppet:///modules/zookeeper/${tarball}",
   ensure => file,
 }

 exec { "zookeeper_untar":
   path => "${zookeeper_parent_dir}",
   command => "tar -xzf ${zookeeper_parent_dir}/${tarball}",
   cwd => "${zookeeper_parent_dir}",
   user => "$user",
   require =>  File["zookeeper-tarball"],
   creates => "${zookeeper_parent_dir}/zookeeper-${zookeeper_version}",
 }

manifests/site.pp我有這個:

Exec {
 path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
}

使用者是root。知道可能是什麼問題嗎?好像$PATH是空的…

您在 zookeeper_untar exec 中將路徑設置為虛假的。不要那樣做,它會再次起作用:)

引用自:https://serverfault.com/questions/483505