v1.6.8 ERROR: a duplicate parameter was found in the argument string

1,513 views
Skip to first unread message

Aaron Bull Schaefer

unread,
Jul 23, 2014, 5:05:59 PM7/23/14
to ansible...@googlegroups.com
A new issue has cropped up for me with v1.6.8 when running a command through the shell module that has an equal sign in the command:

- name: register the zone a nat instance
  shell: 'aws --region {{ aws_region }} ec2 describe-instances --filters "Name=tag:Name, Values=NAT Instance A" "Name=instance-state-code, Values=16" --query "Reservations[*].Instances[*].InstanceId" | jq --raw-output ".[][]"'
  changed_when: false
  register: zone_a_nat_instance

...and the error I'm getting is:

TASK: [aws | register the zone a nat instance] ********************************
fatal: [localhost] => a duplicate parameter was found in the argument string (Name)

FATAL: all hosts have already failed -- aborting

Although there are technically two instances of 'Name=' in my command, it's not an actual Ansible module parameter, but part of the shell command I'd like to run. This task worked previously and no matter how I quote the above task (no surrounding quotes, single quotes, double quotes, -shell: > with a newline then the command, etc.), it throws the same error.

I did find this GitHub issue regarding the same error, but it seems like there are a number of issues going on in that thread: https://github.com/ansible/ansible/issues/8233#issuecomment-49924707

Any quick fixes? Is this an unintended consequence of the security fix?

--
Aaron Bull Schaefer

Michael DeHaan

unread,
Jul 23, 2014, 6:13:58 PM7/23/14
to ansible...@googlegroups.com
So currently the duplicate param detection does look inside some quoted args that it should not.  We're working on a fix for this.

Should only happen when there are Foo= Foo= repeated in a shell/command module, with the equal signs.





--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d66b21ea-0570-4a37-a0d6-af8a3824e344%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Phillips

unread,
Jul 23, 2014, 6:59:11 PM7/23/14
to ansible...@googlegroups.com
It hits the unarchive module too, it would appear. Got bit by that in the middle of a demo/presentation last night (that'll teach me to be running from devel!)

There is a ticket Michael, looks like somebody has already fixed it too, and sent you the PR. 


Cheers

Michael DeHaan

unread,
Jul 23, 2014, 7:11:44 PM7/23/14
to ansible...@googlegroups.com
Yep, Benno works for us and is awesome.

The unarchive fix is now merged, the command module bit is a bit different.




Mark Phillips

unread,
Jul 23, 2014, 7:23:42 PM7/23/14
to ansible...@googlegroups.com
Absolutely brilliant!

Thanks for pulling that in so fast. 
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/pmXrj9jcYBY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

To post to this group, send email to ansible...@googlegroups.com.

vineet daniel

unread,
Nov 6, 2014, 7:50:55 AM11/6/14
to ansible...@googlegroups.com, aarons...@gmail.com

Hi,

I am facing the same issue and there is no clear error as to which parameter is duplicate. 

a duplicate parameter was found in the argument string ()


I am using set_fact to assign values to variable in sub-task. I am including this sub-task in main task and calling ansible-playbook. The code is as follows :

---

- set_fact: 
    port1 = '80'
    domain1 = 'test'
#   timeout1 = '1'
#   balance1  = '1'
#   timeout1_connect = '10'
#  timeout1_server1 = '20'
#  server1  = '2'
#  option1 = '1'


- name: add acl for http
  lineinfile: dest="/tmp/testfile" line="acl host_ '{{ domain1 }}' hdr(host) -i '{{ domain1 }}' " insert_after="bind *:80"

- name: add acl for https
  lineinfile: dest="/tmp/testfile" line="acl host_ '{{ domain1 }}' hdr(host) -i '{{ domain1 }}'" insert_after="bind *:443"

- name: add use_backend line
  lineinfile: dest="/tmp/testfile" line="use_backend '{{ domain1 }}{{ port1 }}'  if host_ '{{ domain1 }}' " insert_before="default_backend f1_default"
  when: port1=80

With above task I tried to add a config block to haproxy config.

Any help would be appreciated.

Michael DeHaan

unread,
Nov 7, 2014, 9:19:36 AM11/7/14
to ansible...@googlegroups.com, aarons...@gmail.com
Please update to Ansible 1.7.2 and see if you have any issues there, we can't support older versions on this list.

Thanks!

--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.

vineet daniel

unread,
Nov 7, 2014, 6:44:33 PM11/7/14
to ansible...@googlegroups.com
hi

i am using 1.7.2 only.

Reply all
Reply to author
Forward
0 new messages