I'm trying to capture the contents of a variable that was registered from a 
previous task, and write it to file for later debugging / troubleshooting 
if the need arises.

The variable essentially has this in it:

{"changed": true, "cmd": ["mongo", "--eval", 
"printjson(rs.add(\"myserver\"))"], "delta": "0:00:00.130748", "end": 
"2015-05-14 22:43:14.453176", "rc": 0, "start": "2015-05-14 
22:43:14.322428", "stderr": "", "stdout": "MongoDB shell version: 
3.0.3\nconnecting to: test\n{\n\t\"ok\" : 0,\n\t\"errmsg\" : \"Found two 
member configurations with same host field, members.1.host == 
members.3.host == myserver\",\n\t\"code\" : 103\n}", "warnings": []}

I then want to record it, possibly to another server...

- copy: content="'{{ theVariable }}'" dest=/somefile-{{ ansible_fqdn }}.json
  delegate_to: masterServer

Ansible fails with the following error:

fatal: a duplicate parameter was found in the argument string ()

I've observed this (or something similar) a couple of times when using the 
"content" parameter with copy.

Is there a way to get copy w/ content + variables to work..?    Aside from 
using shell and | tee  the results.. but there's been a few cases where 
this functionality would have been helpful.

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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f6810d40-9129-4e6d-8a36-48438a28bc2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to