From 7a55e98d299863859a532811eaa0bf5ed4c6c91d Mon Sep 17 00:00:00 2001 From: Alicia Cozine <879121+acozine@users.noreply.github.com> Date: Thu, 18 Mar 2021 14:34:04 -0500 Subject: [PATCH] clarifies docs for file module, addresses issue 72372 (#73938) --- lib/ansible/modules/file.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/file.py b/lib/ansible/modules/file.py index 2446a03e493..347b4e94bf4 100644 --- a/lib/ansible/modules/file.py +++ b/lib/ansible/modules/file.py @@ -36,9 +36,9 @@ options: not exist as the state did not change. - If C(directory), all intermediate subdirectories will be created if they do not exist. Since Ansible 1.7 they will be created with the supplied permissions. - - If C(file), without any other options this works mostly as a 'stat' and will return the current state of C(path). - Even with other options (i.e C(mode)), the file will be modified but will NOT be created if it does not exist; - see the C(touch) value or the M(ansible.builtin.copy) or M(ansible.builtin.template) module if you want that behavior. + - If C(file), with no other options, returns the current state of C(path). + - If C(file), even with other options (such as C(mode)), the file will be modified if it exists but will NOT be created if it does not exist. + Set to C(touch) or use the M(ansible.builtin.copy) or M(ansible.builtin.template) module if you want to create the file if it does not exist. - If C(hard), the hard link will be created or changed. - If C(link), the symbolic link will be created or changed. - If C(touch) (new in 1.4), an empty file will be created if the C(path) does not