stat document 'version' return doc (#76589)

* stat document 'version' return doc

	fixes #76588

* str

* no output_dir for you!
pull/76671/head
Brian Coca 2 years ago committed by GitHub
parent 15ace5a854
commit 8e0654504f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -369,6 +369,12 @@ stat:
type: list
sample: [ immutable, extent ]
version_added: 2.3
version:
description: The version/generation attribute of a file according to the filesystem
returned: success, path exists, user can execute the path, lsattr is available and filesystem supports
type: str
sample: "381700746"
version_added: 2.3
'''
import errno

@ -1,2 +1,3 @@
dependencies:
- prepare_tests
- setup_remote_tmp_dir

@ -17,10 +17,10 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
- name: make a new file
copy: dest={{output_dir}}/foo.txt mode=0644 content="hello world"
copy: dest={{remote_tmp_dir}}/foo.txt mode=0644 content="hello world"
- name: check stat of file
stat: path={{output_dir}}/foo.txt
stat: path={{remote_tmp_dir}}/foo.txt
register: stat_result
- debug: var=stat_result
@ -64,13 +64,13 @@
- name: make a symlink
file:
src: "{{ output_dir }}/foo.txt"
path: "{{ output_dir }}/foo-link"
src: "{{ remote_tmp_dir }}/foo.txt"
path: "{{ remote_tmp_dir }}/foo-link"
state: link
- name: check stat of a symlink with follow off
stat:
path: "{{ output_dir }}/foo-link"
path: "{{ remote_tmp_dir }}/foo-link"
register: stat_result
- debug: var=stat_result
@ -113,7 +113,7 @@
- name: check stat of a symlink with follow on
stat:
path: "{{ output_dir }}/foo-link"
path: "{{ remote_tmp_dir }}/foo-link"
follow: True
register: stat_result
@ -158,13 +158,13 @@
- name: make a new file with colon in filename
copy:
dest: "{{ output_dir }}/foo:bar.txt"
dest: "{{ remote_tmp_dir }}/foo:bar.txt"
mode: '0644'
content: "hello world"
- name: check stat of a file with colon in name
stat:
path: "{{ output_dir }}/foo:bar.txt"
path: "{{ remote_tmp_dir }}/foo:bar.txt"
follow: True
register: stat_result

Loading…
Cancel
Save