1

I am setting my first steps into puppet. I am trying to setup ambari.

This is my puppet config:

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"]]
}

But when my puppet script run, it fails:

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

Note that i uses puppet with vagrant.

Any idea what i am doing wrong?

Thanks

cremersstijn
  • 113
  • 1
  • 1
  • 5

2 Answers2

3

For the ambari-server-setup exec you define a path containing /usr/bin and /usr/sbin.

Most likely you have your bash binary installed as /bin/bash, hence you will also need to include /bin in that path.

andol
  • 6,938
  • 29
  • 43
  • See the FHS for why bash in `/bin`. http://www.pathname.com/fhs/pub/fhs-2.3.html#BINESSENTIALUSERCOMMANDBINARIES - /bin contains commands ... which are required when no other filesystems are mounted – Zoredache Mar 24 '14 at 21:07
-1

I suspect either bash isn't installed, or it isn't in the default path.

When you log on to the puppet client machine, what is the output of:

which bash
Cry Havok
  • 1,845
  • 13
  • 10
  • FYI, `type bash` is better practice than `which bash` (which launches an external command, not guaranteed to behave identically to the shell's own lookup behavior). – Charles Duffy Mar 24 '14 at 20:36
  • Except of course you want the external command, since you don't necessarily know what shell is being used. – Cry Havok Mar 24 '14 at 21:50