How to process output from Ansible using local script
<p>I want to run some command that return some data and process these data somehow with a script that is located on ansible server. How could I do that?</p>

<p>For example:</p>

<p>I want to run</p>

<pre><code>ansible all -a "cat /etc/redhat-release"
</code></pre>

<p>Then I want to call script called <code>version_parser.py</code> (located on local ansible server, not host where ansible is executing the command) with parameters <code>name_of_server</code> and pipe the output of this call as input.</p>

<p>So that in reality I get something similar like</p>

<pre><code>ssh server1 "cat /etc/redhat-release" | version_parser.py server1
ssh server2 "cat /etc/redhat-release" | version_parser.py server2
...
</code></pre>

<p>What is most easy approach to do something like this?</p>