On Fri, May 14, 2021 at 4:24 PM Marc Schlegel <[email protected]> wrote:
>
> Hello everyone
>
> I have to encrypt content in some configuration files on a target host by 
> using encryption utilities provided by middleware (JBoss, Openliberty). The 
> nicest solution would be, to encrypt the text while the template (for the 
> config file) is being processed.
>
> All that is needed is something like the "pipe" lookup plugin, just executed 
> on the target machine of the current task. I know that lookup plugins are 
> executed on the Ansible controller, but nothing should stop me from writing 
> my own lookup-plugin which does the remote execution. Of course this would 
> drastically slow down the template processing but it would be worth it.
>
> My question is, is this feasible at all? Or is there some logic in how the 
> lookup plugin is called which prevent us from doing something like this?
> What I dont want to do is to roll a custom "ssh connect-here-logic", since 
> our envrionments are quite complex so I hoped that a potential plugin could 
> use some runtime information and just execute a remote command somehow.
>
> Of course the other solution is to write the password from the template with 
> some prefex and then replace those things on the target machine using some 
> facts.

Hello,

and what about running a command on target host, save the output on a
fact and then use in template: module?

Luca


-- 
"E' assurdo impiegare gli uomini di intelligenza eccellente per fare
calcoli che potrebbero essere affidati a chiunque se si usassero delle
macchine"
Gottfried Wilhelm von Leibnitz, Filosofo e Matematico (1646-1716)

"Internet è la più grande biblioteca del mondo.
Ma il problema è che i libri sono tutti sparsi sul pavimento"
John Allen Paulos, Matematico (1945-vivente)

Luca 'remix_tj' Lorenzetto, http://www.remixtj.net , <[email protected]>

-- 
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/CAKuX69poDy9Lrh0KcBRXVzkHOm3XcVTcdQeuJphPY0RqbvCHjg%40mail.gmail.com.

Reply via email to