Re: [ansible-project] Run custom lookups in a file a then copy this file to another destination

6 views
Skip to first unread message
Message has been deleted

Matt Martz

unread,
May 25, 2016, 10:50:07 AM5/25/16
to ansible...@googlegroups.com
Custom lookup should still be invoked using the `lookup` function, something like:

myproperty={{ lookup('my_custom_lookup', my_custom_var1) }}

And you would need to use the `template` module as a task to get that templating to be run.  No need for copy, as template can handle a destination.

On Wed, May 25, 2016 at 7:52 AM, mhh <lukas...@gmail.com> wrote:
Hello, is possible to run custom lookups in file and copy this file to another destionation just like in my example?
Or is there any other approach to solve it?
Thanks


    #/path/to/file.properties


    myproperty
={{ my_custom_lookup('{{ my_custom_var1 }}') }}
    myproperty2
={{ my_custom_lookup('{{ my_custom_var2 }}') }}


ansible playbook play:

    - hosts: localhost
      vars
:
          my_custom_var1
: var1
          my_custom_var2
: var2
   
      tasks
:
       
-run lookups in /path/to/file.properties and copy file to another destination

--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/88286d38-edba-4ac0-b01d-56fc328b2a2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net
Reply all
Reply to author
Forward
0 new messages