# Ansible cli argument from with ansible-play

**URL:** <https://forum.ansible.com/t/ansible-cli-argument-from-with-ansible-play/22512>\
**Category:** Ansible Project\
**Created:** [September 8, 2016, 2:11pm UTC](https://forum.ansible.com/t/ansible-cli-argument-from-with-ansible-play/22512 "2016-09-08T14:11:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Marquez](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@Eric\_Marquez](https://forum.ansible.com/u/Eric_Marquez)\
**Post date:** [September 8, 2016, 2:11pm UTC](https://forum.ansible.com/t/ansible-cli-argument-from-with-ansible-play/22512/1 "2016-09-08T14:11:58Z")

</div>

Can somebody give me a pointer for using CLI commands with Ansible-Play.

I working with a group of network devices and I need to issue the same command to all of them to find a specific IP address in the arp table. I would like to do something like the following:

Ansible-play myplay myip=10.10.0.1

Use that myip address in the Ansible-play as a jinja2 variable in my role.

- name: run show arp on remote devices

&nbsp;&nbsp;eos\_command:

&nbsp;&nbsp;&nbsp;&nbsp;commands: show arp {{ myip }}

&nbsp;&nbsp;&nbsp;&nbsp;provider "{{ cli }}"

---

<div class="post-metadata">

**Author:** ![Eric\_Marquez](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@Eric\_Marquez](https://forum.ansible.com/u/Eric_Marquez)\
**Post date:** [September 8, 2016, 2:52pm UTC](https://forum.ansible.com/t/ansible-cli-argument-from-with-ansible-play/22512/2 "2016-09-08T14:52:28Z")

</div>

I found the answer to my own question.

[http://docs.ansible.com/ansible/playbooks\_variables.html#passing-variables-on-the-command-line](http://docs.ansible.com/ansible/playbooks_variables.html#passing-variables-on-the-command-line)
