From ce898bfde50cca8bfe5832c04f5cb4ca091f21d1 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 29 Jan 2019 16:35:08 -0500 Subject: [PATCH] document how state=file works (#50986) * document how state=file works this seems to have been lost in previous updates to docs * Update lib/ansible/modules/files/file.py Co-Authored-By: bcoca --- lib/ansible/modules/files/file.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/files/file.py b/lib/ansible/modules/files/file.py index 1dda03537a0..ca12a7ec9a0 100644 --- a/lib/ansible/modules/files/file.py +++ b/lib/ansible/modules/files/file.py @@ -37,8 +37,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), the file will NOT be created if it does not exist; see the C(touch) - value or the M(copy) or M(template) module if you want that behavior. + - 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(copy) or M(template) module if you want that behavior. - 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