Ask Your Question

Problems with Exec in Puppet

asked 2014-02-12 14:45:10 -0600

MichaelT gravatar image

I want to execute the following command with puppet and exec:

sb2-init rasp /home/ubuntu/raspberry_pi_development/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc

My Puppet Ressource:

exec { "initSB2":
    command => "sb2-init rasp /home/ubuntu/raspberry_pi_development/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc" ,
    cwd => "/home/vagrant/raspberry_pi_development/rootfs",
    path => "/home/vagrant/raspberry_pi_development/scratchbox2/bin",
    user => 'vagrant',
    logoutput => true,

the sb2-init command is in the "/home/vagrant/raspberrypidevelopment/scratchbox2/bin" directory and i want to execute this command in the "/home/vagrant/raspberrypidevelopment/rootfs" Folder.

When i execute this puppet-manifest i get:

notice: /Stage[main]//Exec[initSB2]/returns: /home/vagrant/raspberry_pi_development/scratchbox2/bin ...
edit retag flag offensive close merge delete


When you type it manually, are you 'vagrant' or some other user? That'd make a difference. You should test the script as 'vagrant'.

giavac gravatar imagegiavac ( 2014-02-13 04:30:12 -0600 )edit

I have used the script as vagrant manually

MichaelT gravatar imageMichaelT ( 2014-02-13 11:25:13 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-02-13 04:32:20 -0600

doc75 gravatar image

You need to make sure in the PATH you have all the directory containing the shell itself but also all the other executable launch from this shell. I guess that it calls other shells which are not in the defined PATH.

path can contain an array of strings like that:

path => ['/path/to/dir1', '/path/to/dir2', '/path/to/dir3']

Hope this helps.

edit flag offensive delete link more


I used "echo $PATH" and copied all entries to my puppet path variable as you showed but not working either :-(

MichaelT gravatar imageMichaelT ( 2014-02-13 11:26:30 -0600 )edit

Are you sure to test manually with vagrant user inside the directory "/home/vagrant/raspberry_pi_development/rootfs" ? (to be as closed as possible of your exec). Can you post your new ...(more)

doc75 gravatar imagedoc75 ( 2014-02-13 12:14:00 -0600 )edit

You are right doc, i now tested with vagrant and it not worked! then i tried with sudo and it worked! that means that i can remove the "user => vagrant ...(more)

MichaelT gravatar imageMichaelT ( 2014-02-13 13:16:43 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2014-02-12 14:45:10 -0600

Seen: 701 times

Last updated: Feb 13 '14