mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
file: skip in check_mode if state=touched
This commit is contained in:
parent
06fae59e8b
commit
573ea5bdce
1 changed files with 3 additions and 0 deletions
|
@ -310,6 +310,9 @@ def main():
|
||||||
module.exit_json(dest=path, src=src, changed=changed)
|
module.exit_json(dest=path, src=src, changed=changed)
|
||||||
|
|
||||||
elif state == 'touched':
|
elif state == 'touched':
|
||||||
|
if module.check_mode:
|
||||||
|
module.exit_json(path=path, skipped=True)
|
||||||
|
|
||||||
if prev_state not in ['file', 'directory', 'absent']:
|
if prev_state not in ['file', 'directory', 'absent']:
|
||||||
module.fail_json(msg='Cannot touch other than files and directories')
|
module.fail_json(msg='Cannot touch other than files and directories')
|
||||||
if prev_state != 'absent':
|
if prev_state != 'absent':
|
||||||
|
|
Loading…
Reference in a new issue