我正在设置进入 Puppet 的第一步。我正在尝试设置安巴里。
这是我的傀儡配置:
exec { "ambari-repo":
command => "curl http://public-repo-1.hortonworks.com/ambari/suse11/1.x/updates/1.4.4.23/ambari.repo > /etc/yum.repos.d/ambari.repo",
path => ["/usr/bin", "/usr/sbin"]
}
package {"ambari-server":
ensure => installed,
require => Exec["ambari-repo"]
}
file { "hadoop-dir":
path => "/hadoop",
ensure => "directory"
}
exec { "ambari-server-setup":
command => "ambari-server setup -s",
path => ["/usr/bin", "/usr/sbin"],
cwd => "/hadoop",
user => "root",
require => [Package["ambari-server"], File["hadoop-dir"]]
}
但是当我的 Puppet 脚本运行时,它失败了:
Notice: Compiled catalog for localhost.be in environment production in 0.30 seconds
Notice: /Stage[main]/Main/File[hadoop-dir]/ensure: created
Notice: /Stage[main]/Main/Exec[ambari-repo]/returns: executed successfully
Notice: /Stage[main]/Main/Package[ambari-server]/ensure: created
Notice: Finished catalog run in 49.39 seconds
Stderr from the command:
Error: /usr/bin/env: bash: No such file or directory
Error: /Stage[main]/Main/Exec[ambari-server-setup]/returns: change from notrun to 0 failed: /usr/bin/env: bash: No such file or directory
请注意,我将 puppet 与 vagrant 一起使用。
知道我做错了什么吗?
谢谢
答案1
对于 ambari-server-setup exec,您定义一个包含 /usr/bin 和 /usr/sbin 的路径。
您很可能将 bash 二进制文件安装为 /bin/bash,因此您还需要在该路径中包含 /bin。
答案2
我怀疑 bash 没有安装,或者它不在默认路径中。
当你登录到 puppet 客户端机器时,输出的内容是什么:
which bash