first commit
This commit is contained in:
32
windows_check-if-dir-empty.yml
Normal file
32
windows_check-if-dir-empty.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
- name: run automation for windows
|
||||
gather_facts: no
|
||||
hosts: all
|
||||
become_method: runas
|
||||
tasks:
|
||||
- name: get folder stats
|
||||
ansible.windows.win_stat:
|
||||
path: F:\Data\PON
|
||||
register: folderinfo
|
||||
- name: get folder stats
|
||||
ansible.windows.win_stat:
|
||||
path: F:\Data\GUE
|
||||
register: folderinfo1
|
||||
|
||||
- name: output size
|
||||
debug:
|
||||
var: folderinfo.stat.size / 1048576
|
||||
- name: output size
|
||||
debug:
|
||||
var: folderinfo1.stat.size / 1048576
|
||||
- name: test this
|
||||
debug:
|
||||
msg: "Show output if pon is not empty"
|
||||
when: folderinfo.stat.size != 0
|
||||
- name: test1 this
|
||||
debug:
|
||||
msg: "Show output if gue is empty"
|
||||
when: folderinfo1.stat.size == 0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user