ah, misunderstood, thought you wanted data from executing the script,
not to upload the script itself as data.

On Thu, Apr 30, 2015 at 8:02 PM, Matt Martz <[email protected]> wrote:
> I don't really think pipe is what you need.  pipe executes a command and
> returns the result.  I think 'file' is still appropriate.
>
> As far as your double user_data, you can only include one "blob" of data.
> You could try concatenating the scripts such as:
>
> user_data: "{{ lookup('file', 'proxy-set.sh') ~ '\n' ~ lookup('file',
> 'misc-install.sh') }}"
>
> On Thu, Apr 30, 2015 at 6:58 PM, John Test <[email protected]> wrote:
>>
>> pipe is failing on me
>>
>> pb_set_proxy: "{{ lookup('pipe', 'proxy-set.sh') }}"
>>
>> /bin/sh: 1: proxy-set.sh: not found
>> ERROR: lookup_plugin.pipe(proxy-set.sh) returned 127
>>
>> I know it says not found but it is present and in same dir.
>>
>>
>> I actually have another problem
>>
>> I am using 2 user_data parameters like this in the same nova_compute task
>>
>>    user_data: "{{ lookup('file', 'proxy-set.sh') }}"
>>    user_data: "{{ lookup('file', 'misc-install.sh') }}"
>>
>> Only the misc-install.sh is working and the proxy-set.sh is not.
>> What's the correct way to do this?
>>
>> Thanks!
>>
>>
>>
>> On Thursday, April 30, 2015 at 2:38:25 PM UTC-4, Brian Coca wrote:
>>>
>>> lookup('pipe', 'script') might be more appropriate, it will succeed in
>>> many cases that file will fail.
>>>
>>> On Thu, Apr 30, 2015 at 1:34 PM, John Test <[email protected]> wrote:
>>> > Figured it out thanks to sivel on IRC.
>>> > In case anyone else is wondering just do a lookup('file', 'filename')
>>> > The file called "filename" can be a bash script file, cloud init file,
>>> > etc.
>>> > Make sure the file starts with the appropriate header such as
>>> > #!/bin/bash or #cloud-config etc.
>>> >
>>> >
>>> >
>>> > On Monday, April 27, 2015 at 7:37:45 AM UTC-4, John Test wrote:
>>> >>
>>> >> Hello
>>> >>
>>> >> I have a question regarding user_data parameter for nova_compute
>>> >> http://docs.ansible.com/nova_compute_module.html
>>> >>
>>> >> Is it possible to see some examples?
>>> >>
>>> >> What I am trying to do:
>>> >> Pass information to run commands / install software inside the
>>> >> instance
>>> >> after it is launched
>>> >>
>>> >>
>>> >> Thanks!
>>> >
>>> > --
>>> > 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/bf3b0aad-643f-48cd-b9e0-ccf07d01daea%40googlegroups.com.
>>> >
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>> --
>>> Brian Coca
>>
>> --
>> 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/a96e7a58-525b-4cbe-a7d3-4fc1bef6435d%40googlegroups.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Matt Martz
> @sivel
> sivel.net
>
> --
> 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/CAD8N0v-y8bBt35cG3FVtH4LbWp7dpc9QRqu82jN2-Gnm-nR5pQ%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Brian Coca

-- 
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/CAJ5XC8%3DA48iB9bwMcMSkPQdOkh6r5C7XdLgwDzo%2Bm5u5ttVF9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to