I solved it by including the PATH variable in the launchd file:
    <key>EnvironmentVariables</key>
    <dict>
    <key>PATH</key>
    <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
    </dict>


On Thursday, August 27, 2015 at 11:58:00 AM UTC+2, Ye Na Rhee wrote:
>
> I'm getting these errors when I set launch daemon to run ansible-pull, and 
> it works well when I run the script directly in terminal.
>
> Starting ansible-pull at 2015-08-27 11:46:47
> localhost | FAILED >> {
>     "failed": true, 
>     "msg": "Failed to find required executable git"
> }
>
>
> The launchd file looks like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
>   "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
> <plist version="1.0">
> <dict>
>     <key>Label</key>
>     <string>com.myprogram.ansiblepull</string>
>     <key>ProgramArguments</key>
>     <array>
>     <string>{{ workdir }}/ansible-pull.sh</string>
>     </array>
>     <key>StartInterval</key>
>     <integer>600</integer>
>     
>     <key>RunAtLoad</key>
>     <true/>
>
>     <key>StandardOutPath</key>
>     <string>/var/ansible/log/ansiblepull.out</string>
>     <key>StandardErrorPath</key>
>     <string>/var/ansible/log/ansiblepull.err</string>
>
> </dict>
> </plist>
>
> The path to git is /usr/local/bin/git.
>
> Thanks in advance!
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3a329388-8dfb-4ebd-a194-f6543c0f1317%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to