From b0058546727bc6aa73a8ad1ba7f92b0403ed167a Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 23 Jan 2019 00:59:12 +0800 Subject: [PATCH] copy module "dest" parameter is not only absolute (#50974) We should explain the danger of using relative paths, but we should not say they aren't allowed. Relative paths work and are useful, but the caveat is that the starting point can't be guaranteed by ansible. This commit adds that note, and removes the claim that only absolute paths are accepted. --- lib/ansible/modules/files/copy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/files/copy.py b/lib/ansible/modules/files/copy.py index 968d1477c60..006e60efdcc 100644 --- a/lib/ansible/modules/files/copy.py +++ b/lib/ansible/modules/files/copy.py @@ -38,9 +38,10 @@ options: version_added: '1.1' dest: description: - - Remote absolute path where the file should be copied to. + - Remote path where the file should be copied to. - If I(src) is a directory, this must be a directory too. - If I(dest) is a non-existent path and if either I(dest) ends with "/" or I(src) is a directory, I(dest) is created. + - If I(dest) is a relative path, the starting directory is determined by the remote host. - If I(src) and I(dest) are files, the parent directory of I(dest) is not created and the task fails if it does not already exist. type: path required: yes