From 356d9a272aad838b4259e4bbd31502d915384434 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Wed, 27 Apr 2016 17:31:04 +0200 Subject: [PATCH] Replace ansible_hostname with inventory_hostname (#3559) This way these examples can be re-used using the ansible command (and don't require facts gathering). --- lib/ansible/modules/files/fetch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/files/fetch.py b/lib/ansible/modules/files/fetch.py index 4ca191b8121..f78a6c3c0b3 100644 --- a/lib/ansible/modules/files/fetch.py +++ b/lib/ansible/modules/files/fetch.py @@ -82,11 +82,11 @@ EXAMPLES = ''' - fetch: src=/tmp/somefile dest=/tmp/fetched # Specifying a path directly -- fetch: src=/tmp/somefile dest=/tmp/prefix-{{ ansible_hostname }} flat=yes +- fetch: src=/tmp/somefile dest=/tmp/prefix-{{ inventory_hostname }} flat=yes # Specifying a destination path - fetch: src=/tmp/uniquefile dest=/tmp/special/ flat=yes # Storing in a path relative to the playbook -- fetch: src=/tmp/uniquefile dest=special/prefix-{{ ansible_hostname }} flat=yes +- fetch: src=/tmp/uniquefile dest=special/prefix-{{ inventory_hostname }} flat=yes '''