Thanks Hugo for helping me. Basically I am running a sql command that runs 
a sql query which gives the below results. (this is a debug out)

    "msg": {
        "ansible_facts": {
            "discovered_interpreter_python": "/usr/bin/python"
        },
        "changed": false,
        "failed": false,
        "msg": [
            [
                "Revoke EXECUTE on UTL_FILE from TESTACC1;"
            ],
            [
                "Revoke EXECUTE on UTL_FILE from TESTACC2;"
            ]
        ]
    }
}

What I need to do is to generate another sql statement using this json 
output. When I run your command, it gives me
[u'Revoke EXECUTE on UTL_FILE from TESTACC1;'][u'Revoke EXECUTE on UTL_FILE 
from TESTACC2;']

Is there a filter or something we can use to get a cleaner output ?


On Tuesday, February 11, 2020 at 4:39:08 PM UTC-5, Hugo Gonzalez wrote:
>
> Without knowing anything about how you got those values, it would be {{ 
> query_result.msg | join(' ') }}
>
> Hugo G. 
>
> <https://www.redhat.com> 
>
> If I do 
>     - local_action:
>         copy content={{query_result.msg}}
>         dest=/home/ansible/Playbooks/{{sname}}/sql/revoke.sql
>
> I am getting 
> [["Revoke EXECUTE on UTL_FILE from TESTACC1;"], ["Revoke EXECUTE on 
> UTL_FILE from TESTACC2;"]]
>
> I need to get this
> Revoke EXECUTE on UTL_FILE from TESTACC1; Revoke EXECUTE on UTL_FILE from 
> TESTACC2;
>
> -- 
> 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] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/2a69d90d-3ea8-4615-8f63-ace11f83c622%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/ansible-project/2a69d90d-3ea8-4615-8f63-ace11f83c622%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e42fb674-799a-4f7d-bda2-b7c4905eb8d1%40googlegroups.com.

Reply via email to