Thanks Vlado,
We don't want to maintain separate files.
Here is my
- name: Generate Revoke Statement
local_action:
copy dest= /home/ansible/query.sql
content= {% for line in query_result.msg|flatten %} {{ line }} {%
endfor %}
connection: local
I get --> localhost]: FAILED! => {"changed": false, "msg": "dest is
required"}
Is that something I am missing ?
On Tuesday, February 11, 2020 at 6:06:42 PM UTC-5, Vladimir Botka wrote:
>
> On Tue, 11 Feb 2020 14:59:04 -0800 (PST)
> Anand Solomon <[email protected] <javascript:>> wrote:
>
> > Instead of maintaining another template file. Can I embed the content in
> > the playbook itself ?
>
> Sure you can. Put it into the "content". For example
>
> - local_action:
> copy dest=/scratch/tmp/revoke.sql
> content="{% for line in query_result.msg|flatten %}{{ line }}{%
> endfor %}"
>
> But, why to get rid of the flexibility and modularity?
>
> HTH,
>
> -vlado
>
--
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/2cf96e8b-80a5-43a7-8bcd-7c157854474e%40googlegroups.com.