playbook error for external parameter

Hi All,

I am having one issue,

-e’switch_desc=“interface Gi1/0/16”’

Created ansible playbook for ios_config but when passing the external parameter I am getting one error of Incomplete command as it is reading only “interface” and skipping “Gi1/0/16” this.

I am running my ansible playbook using ssh like below

ssh user@host_ip -C ansible-playbook -i ./hosts /ansibleplaybooks/switch_conf_desc.yml -e’switch_desc=“interface Gi1/0/16”’ --limit host_name

like this I am running my ansible playbook.

Looking forward for your reply.

Thanks & Regards
Sumit Sahay

I can't confirm this behavior, so you must have something wrong in the code you are not showing us.

test.yml

Hi Kai Stian Olstad,

First of all thanks for your reply.
Correct even I am able to run the playbook by using below command, my issue is not this.

I am running my playbook by using ssh like this

ssh user_name@host_ip -C ansible-playbook -i ./hosts /ansibleplaybooks/switch_conf_desc.yml -e’switch_desc=“interface Gi1/0/16”’ --limit host_name

like above and getting below message only

TASK [debug] *******************************************************************
ok: [host_ip] => {
“changed”: false,
“msg”: “interface”
}

only it is taking “interface” not the full string.

that is why I am not able to run this.

Looking forward for your reply.

Regards
Sumit Sahay

To be fair this is not a Ansible problem as you see the Ansible run does work.

It has to do with the shell you are using, try escaping you single quotes, if that doesn't work you probably should find the support list for your shell and ask there.

Hi All,

As per my conversation with Kai Stian Olstad, my issue is not related with ansible but how would I resolve the issue,

As it is not taking full string as parameter skipping the space in between the parameter.

Looking forward for reply.

Thanks & Regards
Sumit Sahay