{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/11896","labels_url":"https://api.github.com/repos/ansible/ansible/issues/11896/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/11896/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/11896/events","html_url":"https://github.com/ansible/ansible/pull/11896","id":99701900,"number":11896,"title":"Add new size computation on mountpoint (used space, block used ...)","user":{"login":"Yannig","id":277760,"avatar_url":"https://avatars.githubusercontent.com/u/277760?v=3","gravatar_id":"","url":"https://api.github.com/users/Yannig","html_url":"https://github.com/Yannig","followers_url":"https://api.github.com/users/Yannig/followers","following_url":"https://api.github.com/users/Yannig/following{/other_user}","gists_url":"https://api.github.com/users/Yannig/gists{/gist_id}","starred_url":"https://api.github.com/users/Yannig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yannig/subscriptions","organizations_url":"https://api.github.com/users/Yannig/orgs","repos_url":"https://api.github.com/users/Yannig/repos","events_url":"https://api.github.com/users/Yannig/events{/privacy}","received_events_url":"https://api.github.com/users/Yannig/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/feature_pull_request","name":"feature_pull_request","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-07T18:19:58Z","updated_at":"2015-08-15T18:10:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/11896","html_url":"https://github.com/ansible/ansible/pull/11896","diff_url":"https://github.com/ansible/ansible/pull/11896.diff","patch_url":"https://github.com/ansible/ansible/pull/11896.patch"},"body":"This pull request replace this one: https://github.com/ansible/ansible-modules-extras/pull/563\r\n\r\nDuring fact gathering, the module compute new values including:\r\n- used space (+percent) ;\r\n- block information ;\r\n- inode information (+percent)."},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/131414246","html_url":"https://github.com/ansible/ansible/pull/11896#issuecomment-131414246","issue_url":"https://api.github.com/repos/ansible/ansible/issues/11896","id":131414246,"user":{"login":"Yannig","id":277760,"avatar_url":"https://avatars.githubusercontent.com/u/277760?v=3","gravatar_id":"","url":"https://api.github.com/users/Yannig","html_url":"https://github.com/Yannig","followers_url":"https://api.github.com/users/Yannig/followers","following_url":"https://api.github.com/users/Yannig/following{/other_user}","gists_url":"https://api.github.com/users/Yannig/gists{/gist_id}","starred_url":"https://api.github.com/users/Yannig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yannig/subscriptions","organizations_url":"https://api.github.com/users/Yannig/orgs","repos_url":"https://api.github.com/users/Yannig/repos","events_url":"https://api.github.com/users/Yannig/events{/privacy}","received_events_url":"https://api.github.com/users/Yannig/received_events","type":"User","site_admin":false},"created_at":"2015-08-15T18:10:22Z","updated_at":"2015-08-15T18:10:22Z","body":"This code include 2 new filter:\r\n* unit: give bytes value of a given value (1|unit('K')=> 1024, 1|unit('M')=> 1048576 ...)\r\n* getmountfrompath: retrieve the corresponding mountpoint of a given path.\r\n\r\nHere's an example of a playbook:\r\n\r\n```json\r\nansible-playbook -i samples/hosts test/integration/test_space_available.yml \r\n\r\nPLAY [Mount check] *************************************************************\r\n\r\nTASK [setup] *******************************************************************\r\nok: [localhost]\r\n\r\nTASK [Get corresponding mountpoint from a given path] **************************\r\nok: [localhost]\r\n\r\nTASK [debug var=mount1] ********************************************************\r\nok: [localhost] => {\r\n    \"changed\": false, \r\n    \"mount1\": {\r\n        \"block_reserved\": 12164467, \r\n        \"block_used\": 30830454, \r\n        \"device\": \"/dev/sda1\", \r\n        \"fstype\": \"ext4\", \r\n        \"inode_free_pc\": 98.71936352542352, \r\n        \"inode_reserved\": 0, \r\n        \"inode_used\": 778745, \r\n        \"inode_used_pc\": 1.2806364745764853, \r\n        \"mount\": \"/\", \r\n        \"options\": \"rw,errors=remount-ro\", \r\n        \"size_available\": 804303634432, \r\n        \"size_available_pc\": 82.03740810740767, \r\n        \"size_total\": 980410830848, \r\n        \"size_used\": 176107196416, \r\n        \"size_used_pc\": 17.962591892592336, \r\n        \"uuid\": \"\"\r\n    }\r\n}\r\n\r\nTASK [debug var=mount2] ********************************************************\r\nok: [localhost] => {\r\n    \"changed\": false, \r\n    \"mount2\": {\r\n        \"block_reserved\": 12164467, \r\n        \"block_used\": 30830454, \r\n        \"device\": \"/dev/sda1\", \r\n        \"fstype\": \"ext4\", \r\n        \"inode_free_pc\": 98.71936352542352, \r\n        \"inode_reserved\": 0, \r\n        \"inode_used\": 778745, \r\n        \"inode_used_pc\": 1.2806364745764853, \r\n        \"mount\": \"/\", \r\n        \"options\": \"rw,errors=remount-ro\", \r\n        \"size_available\": 804303634432, \r\n        \"size_available_pc\": 82.03740810740767, \r\n        \"size_total\": 980410830848, \r\n        \"size_used\": 176107196416, \r\n        \"size_used_pc\": 17.962591892592336, \r\n        \"uuid\": \"\"\r\n    }\r\n}\r\n\r\nTASK [check 1% of free space available for first file] *************************\r\nok: [localhost]\r\n\r\nTASK [1M in bytes equals =>] ***************************************************\r\nok: [localhost] => {\r\n    \"changed\": false, \r\n    \"msg\": \"1048576\"\r\n}\r\n\r\nTASK [check 1M available for second file] **************************************\r\nok: [localhost]\r\n\r\nPLAY RECAP *********************************************************************\r\nlocalhost                  : ok=7    changed=0    unreachable=0\r\n```"}}