Hi All,
I have a simple ansible script that is trying to gather info using the setup module and copying that information onto a temp file. Here is what my script looks like:
- hosts: all
tasks: - name: gather info
setup:
register: info - name: copy info
copy: content=“{{ info }}” dest=/tmp/info_test.log
When I run this script, I get the following error:
fatal: [localhost] => error parsing argument string ‘content="{ …
… // Json formatted information registered in the info variable
…}} " dest=/tmp/info_test.log’, try quoting the entire line.
Is there any other way of capturing the info produced by setup module, and store it in a file?
Also does this seems to be a bug in the copy module? I feel this is failing because the json output is not formatted correctly.
Any help is appreciated.