unarchive.Get a name of file what is inside of src file

16 views
Skip to first unread message

mhh

unread,
Jan 30, 2017, 5:10:31 AM1/30/17
to Ansible Project
Hello,
I found, that is nearly impossible to make a symlink from compressed file, without knowing of what is in this file.
For example i want to do:

-name Untar
unarchive: src={{ my_tar_gz_file }} dest={{ dest }}

-name Make a symlink
 file: src='{{ dest }}/ ????i_dont_know_whats_is_inside_tar_file?? ' dest='{{ dest }}/my_sim_link' state=link

In this compress file can be a file, or folder. Lets assumption, that evertime is folder there. But everytime has a another name, for example build number.
Is this posible to solve it without command: and shell: module? in idepotend style? Of course that unarchive has a parm creates, but it does not work in this case
Thanks

mhh

unread,
Jan 30, 2017, 6:08:08 AM1/30/17
to Ansible Project
Seems that list_files=true and {{ unarchived.files[0] }} alway returns folder in this case

Dne pondělí 30. ledna 2017 11:10:31 UTC+1 mhh napsal(a):
Reply all
Reply to author
Forward
0 new messages