Comments (18)
+1, this seems very basic and makes it hard to use the stat
module without knowing what options are available.
from ansible-modules-core.
+1
Also the initial discussion at ansible/ansible#7457 shows that a lot of people would like to see that in the Ansible documentation.
from ansible-modules-core.
+1, what dellis23 said...
Also, missing from the list above:
checksum - the file's checksum (currently sha1) (added in Ansible 1.8)
from ansible-modules-core.
+1 agree, glad i found this link via google (wouldn't have had time to search python stat module)
from ansible-modules-core.
๐ thanks for doing this! Hopefully it will make it into the real docs someday. ๐
from ansible-modules-core.
For other folks that wind up here: none of these will be avalable if exists
is False
. So you can't just necessarily just test isdir
for instance -- you have to test both result.stat.exists and result.stat.isdir
.
from ansible-modules-core.
That is one of the few things that is present in the current stat documentation. You have to skip down to the examples section to find it.
"#...Note that we need to test
both that p.stat.isdir actually exists, and also that it's set to true."
from ansible-modules-core.
Ah I see:
p.stat.isdir is defined and p.stat.isdir
Unfortunately THAT DOESN'T MAKE IT OKAY!
:-)
from ansible-modules-core.
It sounds like you are suggesting is that these should be False when 'exists' is False:
isdir, ischr, isblk, isreg, isfifo, islnk, issock
The other stat values don't have meaning if exists is False. A change like that would be simple to make and backward compatible.
from ansible-modules-core.
Yeah, that sounds reasonable to me. Still, my overall point is that the documentation here is the biggest problem.
from ansible-modules-core.
so this is one documentation solution that is being proposed for all modules:
https://groups.google.com/forum/#!topic/ansible-devel/5OuTJXZWgvY
from ansible-modules-core.
I have been looking at doing some documentation patches for ansible and this is one I'd really like to see fixed, but the challenge of explaining how some of the variables show up some of the time and other times do not did not sound like a good time to me. ๐ฑ If this were cleaned up as twekberg suggests it would make ansible much more useful and cause fewer nightmares for whoever actually gets it documented properly.
dellis23 said:
| Still, my overall point is that the documentation here is the biggest problem.
๐ You are totally correct. The weak docs are a sad impediment for a project that seems to be so excellent otherwise.
@bcoca that sounds like a good direction to go.
from ansible-modules-core.
@bcoca I like that. (https://github.com/bcoca/ansible-modules-core/commit/9575cbc99f8ed43d37a54b47430a2b72e3e8c7ba is the commit, for anyone else).
from ansible-modules-core.
created 2 PRs #823 (now also documents stat module) and ansible/ansible#10295 implements the viewer in ansible-doc
from ansible-modules-core.
Forget about my 'backward compatible' comment on Feb 17. It isn't
from ansible-modules-core.
Bcoca: I reviewed the PR #823 and made some comments. Hopefully you got them.
from ansible-modules-core.
@twekberg already updated PR, check again
from ansible-modules-core.
closing via merged #823
from ansible-modules-core.
Related Issues (20)
- .. HOT 1
- azure_rm_deployment: InvalidClientIdError: (invalid_request) AADSTS90002: Requested tenant identifier 'xxxxxx.com'' is not valid. HOT 1
- 'dict object' has no attribute 'stdout' HOT 1
- unarchive does not work for .zip file on ansible 2.2.1 on windows Environment HOT 1
- async polling doesnt work HOT 1
- ansible_s3 does not support delegate_to HOT 2
- vyos_config has timeout after some unknown number of commands HOT 1
- Include_vars in free-form mode requires a file extension, breaking reverse compatibility HOT 1
- pushing jinja2 configurations on to network devices HOT 1
- 'list' object has no attribute 'items'\r\n" HOT 3
- Cisco Nexus N3K - QinQ issue HOT 1
- "msg": "failed to create temporary content file: timed out". Can someone help me on this. HOT 1
- Uri module modifies + sign to spaces HOT 1
- template error while templating string: unexpected ']' After Dictionary Combine HOT 1
- Yum install with Corrupt repo endless loop HOT 1
- ios_command failure for cisco with rc=1 HOT 2
- nxos_interface module does not work HOT 1
- ios_config backup not working on windows shared drive HOT 2
- ansible_module_azure_rm_virtualmachine incompatible with Python3 HOT 1
- Path parameter should work like file copy module HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-modules-core.