# Run a command with different args everytime in Ansible playbook

**URL:** <https://forum.ansible.com/t/run-a-command-with-different-args-everytime-in-ansible-playbook/32790>\
**Category:** Ansible Project\
**Created:** [April 27, 2020, 12:57pm UTC](https://forum.ansible.com/t/run-a-command-with-different-args-everytime-in-ansible-playbook/32790 "2020-04-27T12:57:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xenia\_Ioannidou](https://avatars.discourse-cdn.com/v4/letter/x/8e8cbc/32.png) [@Xenia\_Ioannidou](https://forum.ansible.com/u/Xenia_Ioannidou)\
**Post date:** [April 27, 2020, 12:57pm UTC](https://forum.ansible.com/t/run-a-command-with-different-args-everytime-in-ansible-playbook/32790/1 "2020-04-27T12:57:59Z")

</div>

I am trying to run a command in Ansible so as to find the neighbors in my network:

```auto
- name: Get neighbors
  junos_rpc:
    rpc: "get-lldp-interface-neighbors"
    output: 'xml'
    args:
      interface_device: A
  register: net_topology

```

```auto
I have tried to loop over the args like this:

```
