Just ran into the same issue. I hope the "content" argument doesn't go 
away; it's very useful for simple things like SSH keys. But maybe you can 
document that using it with multi-line variables requires the long module 
syntax.


On Monday, October 6, 2014 5:29:09 AM UTC-7, Michael DeHaan wrote:
>
> I'm not positive it's going away, but you can use conditionals in a 
> template, technically, if that helps you out.
>
>
>
> On Sun, Oct 5, 2014 at 7:41 PM, Alexandr Kurilin <[email protected] 
> <javascript:>> wrote:
>
>> Assuming copy content goes away, is there any way to simplify the 
>> template module? Right now if I want to copy a PEM cert from the vault onto 
>> a target host, I have to create a set of files such as cert.j2 and key.j2 
>> with contents {{ cert }} and {{ key }} respectively, so now I have to 
>> manage two additional files in my repo.
>>
>>
>> On Monday, September 29, 2014 3:15:27 PM UTC-7, Jeffrey Wong wrote:
>>>
>>> Thanks for the clarification!
>>>
>>> I'll go ahead and use a template instead if that's what you're 
>>> recommending. It makes the most sense to deprecate/undocument content if 
>>> it's difficult to rectify strange differences with corner cases like that.
>>>
>>> Thanks!
>>>
>>> On Sunday, September 28, 2014 12:29:29 PM UTC-7, Michael DeHaan wrote:
>>>>
>>>> Those changes are related to some security fixes and various related 
>>>> changes as a result of those fixes that came later, all aimed at 
>>>> preventing 
>>>> unexpected argument insertion given untrusted data from remote hosts.
>>>>
>>>> So {{ foo }} is a request to insert something into a line, the way you 
>>>> have it above, and then ansible converts that into module arguments.
>>>>
>>>> I have considered just undocumenting the "content" parameter -- we're 
>>>> likely to do that -- as I think it leads to some confusing practices, 
>>>> better served by "template" in most cases.
>>>>
>>>> One of those examples is pushing an embedded shell script inside a 
>>>> playbook, when it could have been done in a one-liner with the "script" 
>>>> module.
>>>>
>>>> If you think you can fix it and still keep the argument 
>>>> detection/parsing in place, I'd be interested - but that's why it was 
>>>> closed with the reasons given, and why I suggested how to avoid this.
>>>>
>>>> The long form is also needed to pass structured data to modules, as is 
>>>> shown with the ec2 examples.
>>>>
>>>

-- 
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/055966cf-b9ef-45b5-bd9b-6fa180dea983%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to