Hi,
wanted to list the files in a directory and copy the only file name into
property file,
using by win_shell:
- name:list the files
win_shell: 'ls {{directory}} > {{directory}}/manifest.prob'
register: dir_out
- debug: var={{item}}
with_items: dir_out.stdout_lines
out put as
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 9/9/2019 9:05 AM 7289 Database_0.0.100.zip
-a---- 9/9/2019 9:03 AM 18447
EMC_ECS-package_0.0.100.zip
-a---- 9/17/2019 1:02 PM 0 file.txt
-a---- 9/9/2019 9:05 AM 7434 hotfix-DDMInfra.zip
-a---- 9/9/2019 9:03 AM 15631 hotfix-IIS.zip
-a---- 9/9/2019 9:05 AM 16808
hotfix-QCIM1H126382-v3.zip
I don't want other information, How list only file names?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAFMhZ_L7_yD7193kScoaJzDGJh6v0rxGOcg8-aO_FsZFOgN8Vw%40mail.gmail.com.