Why extra variables (-e) ignoring commands after pipeline ("|") while
running playbook with -e options.

Following playbook giving output till "netstat -an" only. I want the output
of this "netstat -an | grep 8080" or any command which can be run at the
run time on remote host.

ansible-playbook /etc/ansible/command_run.yml -e "ip=" -e
'command="netstat -an | grep 8080"'


- hosts: "{{ip}}"
  gather_facts: no
  remote_user: remote
  connection: local

   - name: Running command
     command: ansible {{ip}} -a "{{command}}"

However, Following is working.

ansible-playbook /etc/ansible/command_run.yml -e "ip=" -e
'command="free -m"'.

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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to