Using bash <file> in ansible playbook from cron

7 views
Skip to first unread message

mark....@neonova.net

unread,
Nov 15, 2017, 10:55:05 AM11/15/17
to Ansible Project
Bear with me here, since this is one odd problem.  I have a playbook that I'm trying to run from cron.  One step in the playbook is to execute a series of commands in a plain text file like:
rd.pl <data>
rd.pl <data>

This has to be done using 'bash <filename> '.  When running this in a console it works just fine.  However, when running from cron it fails with 'rd.pl: command not found'.  This might be a path issue, but I'm not sure how to fix it.  FWIW, this perl script isn't one I built and nothing I do fixes the fact it's crap and refuses to take proper arguments, etc.  Is there a way to make this behave other than just running this playbook in a for loop in a screen session?

Jon Adcock

unread,
Nov 15, 2017, 1:10:46 PM11/15/17
to Ansible Project
Try specifying the full path to the rd.pl file in the playbook that actually runs rd.pl, e.g.,  /some/directory/path/rd.pl
Jon
Reply all
Reply to author
Forward
0 new messages