I am developing a web interface that will eventually be fetching 
information using ansible jobs.

The language I am using for the web interface is PHP.

I am trying to write a PHP script that will run an ansible playbook and 
eventually return the jobs results on my screen.

The question is PHP script is running everything as apache user. How can I 
switch over to ansible user inside my php flow.

My php script looks like:

<?php


chdir('/home/ansible/ansible');
$output = shell_exec('pwd');
echo "<pre>$output</pre>";
shell_exec('ansible-playbook si-report-api-count.yml -i production');

$output = shell_exec('cat /tmp/log');
echo "<pre>$output</pre>";

?> 

When I run this, it doesnt run the playbook. Im suspecting that the apache 
user cant do that. It is not even switching over to the ansible directory.

Any ideas? 

-- 
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/368a8499-572c-4d83-8869-9df22ef89469%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to