{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3443","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3443/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3443/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3443/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/3443","id":148616756,"number":3443,"title":"Idea on file module: avoid rm -fr /","user":{"login":"HanXHX","id":5664215,"avatar_url":"https://avatars.githubusercontent.com/u/5664215?v=3","gravatar_id":"","url":"https://api.github.com/users/HanXHX","html_url":"https://github.com/HanXHX","followers_url":"https://api.github.com/users/HanXHX/followers","following_url":"https://api.github.com/users/HanXHX/following{/other_user}","gists_url":"https://api.github.com/users/HanXHX/gists{/gist_id}","starred_url":"https://api.github.com/users/HanXHX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HanXHX/subscriptions","organizations_url":"https://api.github.com/users/HanXHX/orgs","repos_url":"https://api.github.com/users/HanXHX/repos","events_url":"https://api.github.com/users/HanXHX/events{/privacy}","received_events_url":"https://api.github.com/users/HanXHX/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-15T09:59:02Z","updated_at":"2016-04-15T13:20:24Z","closed_at":null,"body":"##### ISSUE TYPE\r\n - Feature Idea\r\n\r\n##### COMPONENT NAME\r\nFile\r\n\r\n##### ANSIBLE VERSION\r\nNA\r\n\r\n##### CONFIGURATION\r\nNA\r\n\r\n##### OS / ENVIRONMENT\r\nNA\r\n\r\n##### SUMMARY\r\n\r\nSee: http://www.independent.co.uk/life-style/gadgets-and-tech/news/man-accidentally-deletes-his-entire-company-with-one-line-of-bad-code-a6984256.html\r\n\r\nI think we can avoid some part this problem on file module.\r\n\r\n##### STEPS TO REPRODUCE\r\n\r\n```\r\n- hosts: dummy\r\n  vars:\r\n    a: \"\"\r\n    b: \"\"\r\n  tasks:\r\n    - file: path=\"{{ a }}/{{ b }}\" state=absent\r\n```\r\n\r\n##### EXPECTED RESULTS\r\n\r\nFatal error!\r\n\r\n##### ACTUAL RESULTS\r\nIt destroys all your data.\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/210461840","html_url":"https://github.com/ansible/ansible-modules-core/issues/3443#issuecomment-210461840","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/3443","id":210461840,"user":{"login":"dagwieers","id":388198,"avatar_url":"https://avatars.githubusercontent.com/u/388198?v=3","gravatar_id":"","url":"https://api.github.com/users/dagwieers","html_url":"https://github.com/dagwieers","followers_url":"https://api.github.com/users/dagwieers/followers","following_url":"https://api.github.com/users/dagwieers/following{/other_user}","gists_url":"https://api.github.com/users/dagwieers/gists{/gist_id}","starred_url":"https://api.github.com/users/dagwieers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagwieers/subscriptions","organizations_url":"https://api.github.com/users/dagwieers/orgs","repos_url":"https://api.github.com/users/dagwieers/repos","events_url":"https://api.github.com/users/dagwieers/events{/privacy}","received_events_url":"https://api.github.com/users/dagwieers/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T13:20:24Z","updated_at":"2016-04-15T13:20:24Z","body":"Yes, the file module should not automatically recurse when deleting directories.\r\nRecursion should be explicit.\r\n\r\nAnd maybe, while we're at it, disable removal of / altogether, just like rm does these days. (See option `--no-preserve-root`)"}}