From 95e5f890896cf37df59d6ccdf8bc5e2dd4b962fb Mon Sep 17 00:00:00 2001 From: Steve Bonds Date: Mon, 1 Apr 2019 14:44:12 -0700 Subject: [PATCH] Clarify source of the host name (#54693) The host could have been either the inventory name (`inventory_hostname`) or the discovered hostname (`ansible_hostname`) Inspecting the source code of `fetch.py` shows that the inventory name is preferred. ``` if 'inventory_hostname' in task_vars: target_name = task_vars['inventory_hostname'] ``` --- lib/ansible/modules/files/fetch.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ansible/modules/files/fetch.py b/lib/ansible/modules/files/fetch.py index 9075cfc7c18..e0a6a5264d3 100644 --- a/lib/ansible/modules/files/fetch.py +++ b/lib/ansible/modules/files/fetch.py @@ -34,6 +34,7 @@ options: - A directory to save the file into. - For example, if the I(dest) directory is C(/backup) a I(src) file named C(/etc/profile) on host C(host.example.com), would be saved into C(/backup/host.example.com/etc/profile). + The host name is based on the inventory name. required: yes fail_on_missing: version_added: '1.1'