This is based upon this hoax question here. The problem described is having a bash script which contains something to the effect of:
rm -rf {pattern1}/{pattern2}
...which if both patterns include one or more empty elements will expand to at least one instance of rm -rf /
, assuming that the original command was transcribed correctly and the OP was doing brace expansion rather than parameter expansion.
In the OP's explanation of the hoax, he states:
The command [...] is harmless but it seems that almost no one has noticed.
The Ansible tool prevents these errors, [...] but [...] no one seemed to know that, otherwise they would know that what I have described could not happen.
So assuming you have a shell script that emits an rm -rf /
command through either brace expansion or parameter expansion, is it true that using Ansible will prevent that command from being executed, and if so, how does it do this?
Is executing rm -rf /
with root privileges really "harmless" so long as you're using Ansible to do it?