# Importing variables from remote files

**URL:** <https://forum.ansible.com/t/importing-variables-from-remote-files/2275>\
**Category:** Get Help\
**Tags:** playbook\
**Created:** [November 9, 2023, 4:55pm UTC](https://forum.ansible.com/t/importing-variables-from-remote-files/2275 "2023-11-09T16:55:09Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![charlesrocket](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/charlesrocket/32/986_2.png) [@charlesrocket](https://forum.ansible.com/u/charlesrocket)\
**Post date:** [December 6, 2023, 2:30pm UTC](https://forum.ansible.com/t/importing-variables-from-remote-files/2275/21 "2023-12-06T14:30:36Z")

</div>

Still no luck with templating, guessing I am not supposed to have any. So decided to convert with these builtins to stay on the safe side:

```auto
- name: Prepare temporary files
  ansible.builtin.tempfile:
    state: directory
  register: temp_vars
  delegate_to: localhost

- name: Fetch remote variables
  ansible.builtin.uri:
    url: "{{ fetch_vars_url }}"
    dest: "{{ temp_vars.path + '/vars.yaml' }}"
  delegate_to: localhost

- name: Add remote variables
  ansible.builtin.include_vars:
    file: "{{ temp_vars.path + '/vars.yaml' }}"

```

temp tasks are (probably) getting no change attr

[Previous page](https://forum.ansible.com/t/importing-variables-from-remote-files/2275.md?page=1)
