Get facts control machine

24 views
Skip to first unread message

Thomas Steinbach

unread,
Nov 29, 2015, 7:27:21 PM11/29/15
to Ansible Project
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.

Brian Coca

unread,
Dec 1, 2015, 9:55:40 PM12/1/15
to Ansible Project
lookup('env', 'HOME) should give you the home dir of the 'current user
executing ansible'. Also ~ and $HOME should work with the fetch
module.
--
Brian Coca
Reply all
Reply to author
Forward
0 new messages