Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible solutions for getting var as a file on a remote system? #1

Open
gardar opened this issue Nov 29, 2023 · 1 comment
Open

Possible solutions for getting var as a file on a remote system? #1

gardar opened this issue Nov 29, 2023 · 1 comment

Comments

@gardar
Copy link

gardar commented Nov 29, 2023

First of all thanks for creating this! I have often speculated about the possibility of using variable as a file in Ansible (and according to my google search so do others).

As lookups happen on localhost, have looked into if and how it would be possible to get the same result on a remote host?

I guess it would have to happen either by abusing the lookup function somehow or perhaps as a filter, since those are the only two ways that one can call functions in Ansible as a part of a string/variable. Either way it looks like the solution would involve some creative hacking.

@zeitounator
Copy link
Member

Hi and thanks for your interest.

Why don't you simply use ansible.builtin.copy? In that case you don't even need all this demo collection as you can simply pass the variable in content. And then you just have to use that file wherever it is needed and possibly clean it up once done. Or am I misinterpreting your expectation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants