Get facts control machine

Hi, I want to fetch some files from the remote server and store them in the home directory of the user executing the playbook. How do I get the ‘ansible_user_dir’ of the ansible control machine? I can’t use ‘$HOME’ or ‘~’, because those statements would not work with all Ansible modules.

lookup('env', 'HOME) should give you the home dir of the 'current user
executing ansible'. Also ~ and $HOME should work with the fetch
module.