you are probably buffering the output in php

On Thu, Jan 21, 2016 at 6:36 AM, Sally Paner <[email protected]> wrote:
> Hi Brian;
>
>
> Thanks for the reply.  I am just wondering that if I run ansible-playbook
> directly on the command line, it gives me real-time output, but if called
> from PHP it seems that ansible-playbook waits to finish the playbook before
> it returns any output.
>
>
>
> On Wednesday, January 20, 2016 at 10:04:35 PM UTC+8, Brian Coca wrote:
>>
>> There is no currently available 'intermediate updates' feature.
>>
>> On Wed, Jan 20, 2016 at 8:08 AM, Sally Paner <[email protected]> wrote:
>> > I have a simple PHP script that runs ansible-playbook and polls the
>> > output.
>> > It seems that ansible runs to completion before it displays the output.
>> > This is my simple code:
>> > (process.php)
>> > $handle = popen("ansible-playbook
>> > set-mysqld-max-connection-with-template.yml", "r");
>> >
>> > while(!feof($handle)) {
>> > $buffer = fgets($handle);
>> >       echo $buffer . "\n";
>> >    usleep(100000); //sleep for 0.1 seconds
>> > }
>> > pclose($handle);
>> >
>> > Output:
>> > PLAY [web]
>> > ********************************************************************
>> >
>> > GATHERING FACTS
>> > ***************************************************************
>> > ok: [selenium1.example.com]
>> >
>> > TASK: [set-mysqld-max-connection-with-template | set mysqld (my.cnf)
>> > max_connection with template] ***
>> > ok: [selenium1.example.com]
>> >
>> > PLAY RECAP
>> > ********************************************************************
>> > selenium1.example.com       : ok=2    changed=0    unreachable=0
>> > failed=0
>> >
>> >
>> >
>> > --
>> > 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/b159af10-7fce-4b69-b6c1-4eb7191d89aa%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Brian Coca
>
> --
> 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/a4e09b7e-1ad6-4b0d-bc59-0de72f87fe35%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Brian Coca

-- 
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/CAJ5XC8kSQG_gnh5OgQM22e0Ay4jwSvagQphinY_zJAMFFyb0Pg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to