thoteam / thoteam.var_as_file / 1.0.1 / lookup / var_as_file Get a file path containing a variable/content Authors: Olivier Clavel (@zeitounator)thoteam.var_as_file.var_as_file (1.0.1) — lookup
Install with ansible-galaxy collection install thoteam.var_as_file:==1.0.1
collections: - name: thoteam.var_as_file version: 1.0.1
Creates a temporary file with the content passed as argument and returns its path on the controller.
- name: Get a filename with the given content for later use ansible.builtin.set_fact: my_tmp_file: "{{ lookup('thoteam.var_as_file.var_as_file', some_variable) }}"
- name: Use in place in a module where a file is mandatory and you have the content in a var community.general.java_cert: pkcs12_path: "{{ lookup('thoteam.var_as_file.var_as_file', pkcs12_store_from_vault) }}" cert_alias: default keystore_path: /path/to/my/keystore.jks keystore_pass: changeit keystore_create: yes state: present
_content: description: the content that should be included in the file. required: true
_raw: description: - path to the temporary file with the content. type: str