how to get a binary file to stop the install if exist

I have a binary file to install called install.sh on the master under /data/binary, I need to fix my code to only install it if the file exist and want to have it only copy the file if the agent is not installed.

I am not sure how my onlyif should look like, as if now, if only check the file if exist but puppet the ensure already doing that.

Comments

What do you mean, are you saying you only want the exec statement to run once? Instead of onlyif use the creates parameter and point it at a log file or something of that sort that your script creates. That will make sure it only runs once.