Repository: ansible/ansible-modules-core

Issue:
stat: readable and writeable are missing
##### ISSUE TYPE
- Bug Report
##### COMPONENT NAME

stat
##### ANSIBLE VERSION

```
ansible 2.1.2.0
  config file = xxx/ansible.cfg
  configured module search path = Default w/o overrides
```
##### OS / ENVIRONMENT

Debian 8
##### SUMMARY

In the stat dict the keys "readable" and "writeable" are missing. These keys are mentioned in the documentation [http://docs.ansible.com/ansible/stat_module.html](url).
##### STEPS TO REPRODUCE

```
  - stat: path=/etc
    name: check /etc
    register: path
  - fail: msg="/etc is not there"
    when: not path.stat.exists
  - fail: msg="/etc is not readable"
    when: not path.stat.readable
```
##### EXPECTED RESULTS

correct evaluation of path.stat.readable
##### ACTUAL RESULTS

```
fatal: [xxx]: FAILED! => {"failed": true, "msg": "The conditional check 'not path.stat.readable' failed. The error was: error while evaluating conditional (not path.stat.readable): 'dict object' has no attribute 'readable'\n\nThe error appears to have been in 'xxx/playbook.yml': line x, column x, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n    when: not path.stat.exists\n  - fail: msg=\"/etc is not readable\"\n    ^ here\n"}
```



Discussion:
<!-- @buechele: Thanks for filing this bug report! -->

@bpennypacker ping, this issue is waiting for your response.
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)

<!--- boilerplate: issue_bug_new --->

those response fields were added in 2.2 so should not be present in your version, changing this as a doc issue as they should specify in which version they were added.

cc @resmo, @tobixx FYI, please make sure new features always document the version

Thanks @bcoca !!!

@bpennypacker, ping. This issue is still waiting on your response.
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)

<!--- boilerplate: issue_renotify_maintainer --->

@bpennypacker, ping. This issue is still waiting on your response.
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)

<!--- boilerplate: issue_renotify_maintainer --->


Resolving patch:
diff --git a/files/stat.py b/files/stat.py
--- a/files/stat.py
+++ b/files/stat.py
@@ -303,17 +303,17 @@
             type: string
             sample: us-ascii
         readable:
-            description: Tells you if the invoking user has the right to read the path
+            description: Tells you if the invoking user has the right to read the path, added in version 2.2
             returned: success, path exists and user can read the path
             type: boolean
             sample: False
         writeable:
-            description: Tells you if the invoking user has the right to write the path
+            description: Tells you if the invoking user has the right to write the path, added in version 2.2
             returned: success, path exists and user can write the path
             type: boolean
             sample: False
         executable:
-            description: Tells you if the invoking user has the execute the path
+            description: Tells you if the invoking user has the execute the path, added in version 2.2
             returned: success, path exists and user can execute the path
             type: boolean
             sample: False


Test patch: