I am running into the same issues and I wonder if anyone has come up with a 
solution to this? +1 from me.

Am Mittwoch, 11. Juni 2014 20:57:47 UTC+2 schrieb Michael DeHaan:
>
> It's a devel topic mostly, but the answer is no, because lookup plugins 
> are just going to evaluate to string parameters here, and this is an 
> inefficient way to pass large files to remote hosts.
>
>
>
>
>
> On Tue, Jun 10, 2014 at 10:42 AM, Guy Matz <[email protected] <javascript:>
> > wrote:
>
>> OR - and I think I prefer this - should I create a new lookup_plugin 
>> called rawfile (binfile previously mentioned in this post) that doesn't do 
>> any encoding and simply slurps the file in?
>>
>> Should this post be in "Ansible Development"?
>>
>> Thanks again,
>> Guy
>>
>>
>> On Monday, June 9, 2014 4:40:39 PM UTC-4, Michael DeHaan wrote:
>>
>>> Ok, yes.
>>>
>>> The proposal seems like it should be to make the uri module take an 
>>> optional "file" parameter, so the lookup plugin doesn't have to use the 
>>> content parameter.
>>>  
>>> This will prevent the need to transfer the file in the arguments, which 
>>> could get ungainly for large files.
>>>
>>> --Michael
>>>
>>>
>>> On Mon, Jun 9, 2014 at 12:13 PM, Guy Matz <[email protected]> wrote:
>>>
>>>> That 'file:///' part is there so that the uri module can be notified 
>>>> that the body data is actually in a file and should be read in from disk . 
>>>> . .  I don't really like that because it seems a little too magical.
>>>>
>>>> I prefer either amending the current file lookup plugin to read binary 
>>>> data if the file is such (currently it is only able to read text files) or 
>>>> adding a bin_file lookup that is not concerned about utf8, etc.
>>>>
>>>> That make any more sense?  :-(
>>>>
>>>> Thanks a lot,
>>>> Guy
>>>>
>>>>
>>>> On Sun, Jun 8, 2014 at 11:31 AM, Michael DeHaan <[email protected]> 
>>>> wrote:
>>>>
>>>>> I actually don't understand my response to the 1st question of this 
>>>>> thread, that may have been a mis-post.
>>>>>
>>>>> "   # if body is a file URL, e.g. 'file:///bin/false', read it in and 
>>>>> replace the text of body with the binary contents of the file"
>>>>>
>>>>> Sorry, also not following.
>>>>>
>>>>>
>>>>>  
>>>>>
>>>>> On Fri, Jun 6, 2014 at 9:52 AM, Guy Matz <[email protected]> wrote:
>>>>>
>>>>>>  Hi!  How do you feel about something like this for the uri module?
>>>>>>    # module.params section
>>>>>>
>>>>>>    # if body is a file URL, e.g. 'file:///bin/false', read it in and 
>>>>>> replace the text of body with the binary contents of the file
>>>>>>    if urlparse.urlparse(body).scheme == 'file':
>>>>>>         try:
>>>>>>             body = open(urlparse.urlparse(body).path, 'rb').read()
>>>>>>         except Exception as e:
>>>>>>             module.fail_json(msg="failed to open %s for body: %s" % 
>>>>>> (urlparse.urlparse(body).path, str(e) ) )
>>>>>>
>>>>>> Should file location be relative to roles dir?
>>>>>>
>>>>>> Thanks a lot!!!!
>>>>>>
>>>>>> Guy
>>>>>>
>>>>>>
>>>>>> On Saturday, May 31, 2014 12:28:28 PM UTC-4, Michael DeHaan wrote:
>>>>>>
>>>>>>> All the arguments are passed on the command line for that module 
>>>>>>> versus loaded form local files, so probably not.   Patches to accept a 
>>>>>>> data 
>>>>>>> file to read would be accepted.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, May 29, 2014 at 10:07 AM, Guy Matz <[email protected]> wrote:
>>>>>>>
>>>>>>>>  Hi!  Anyone know if it's possible to test the upload of a binary 
>>>>>>>> file using the uri module?  It doesn't look like httplib2 has this 
>>>>>>>> functionality . . .
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Guy
>>>>>>>>  
>>>>>>>> -- 
>>>>>>>> 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/d2cf9f61-
>>>>>>>> f941-411b-9bd4-db0e269efee7%40googlegroups.com 
>>>>>>>> <https://groups.google.com/d/msgid/ansible-project/d2cf9f61-f941-411b-9bd4-db0e269efee7%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>>
>>>>>>>  -- 
>>>>>> 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/85069925-7e89-4036-9861-
>>>>>> 748061c5ad63%40googlegroups.com 
>>>>>> <https://groups.google.com/d/msgid/ansible-project/85069925-7e89-4036-9861-748061c5ad63%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>>  -- 
>>>>> 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/CA%2BnsWgwd_wT7UES6V2%3D%2B5a2wAOVzaZr-hwGsEuQQ-
>>>>> 7RD9nkmLw%40mail.gmail.com 
>>>>> <https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwd_wT7UES6V2%3D%2B5a2wAOVzaZr-hwGsEuQQ-7RD9nkmLw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>  
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>  -- 
>>>> 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/CABnTgtXYQt15CYv5yV%3DD0ztidmUr4L-
>>>> ZeN3kgevpYGoWr8f4cA%40mail.gmail.com 
>>>> <https://groups.google.com/d/msgid/ansible-project/CABnTgtXYQt15CYv5yV%3DD0ztidmUr4L-ZeN3kgevpYGoWr8f4cA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  -- 
>> 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 post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/1b8ce4d7-dc39-460f-bff6-cd51cfd2446a%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/1b8ce4d7-dc39-460f-bff6-cd51cfd2446a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/9d2cf4c1-cc45-466c-aa38-d07561b89e63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to