puppet 环境变量 $PATH 未设置

puppet 环境变量 $PATH 未设置

我正在尝试在 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是空的...

答案1

您在 zookeeper_untar exec 中将路径设置为虚假路径。不要这样做,它会再次正常工作 :)

相关内容