The actual folder had 777 permissions as seen below:
drwxrwxrwx 3 destuser destuser 29 Jan 14 08:40 /tmp/mohtas/folder
I took the backup using the below playbook and wanted to preserve the permissions i.e 777 for the backup folder /tmp/mohtas/folder.bkp.15Jan2021_090700
I don’t recall claiming that I was sane, only that the shell module would work. Plus, it is less work, being only five
letters instead of seven.
From the official documentation:
If you want to execute a command securely and predictably, it may be better to use the ansible.builtin.command module
instead. Best practices when writing playbooks will follow the trend of using ansible.builtin.command unless the
ansible.builtin.shell module is explicitly required. When running ad-hoc commands, use your best judgement.
On top of that using "command" is more efficient as it doesn't need to go through the shell.
I don't want to comment on "it is less work" clause.