Fixed backup file behavior in check mode (#24899)

Fixes ansible/ansible#21523
pull/25074/head
Evan Kaufman 8 years ago committed by René Moser
parent a1709bf0f9
commit ce584571e8

@ -752,12 +752,11 @@ def main():
res_args['diff'] = diff
# retain the backup only if crontab or cron file have changed
if backup:
if backup and not module.check_mode:
if changed:
res_args['backup_file'] = backup_file
else:
if not module.check_mode:
os.unlink(backup_file)
os.unlink(backup_file)
if cron_file:
res_args['cron_file'] = cron_file

Loading…
Cancel
Save