use win_get_url and with_items with a list of zips you want to download,
and also use 'register' to capture which files were downloaded into a
variable with a name like download_list. Also set 'force=no' on
win_get_url so that it only fetches each zip once.
Then you can use the results in download_list to make a new list of zips
that need extracting ( changed=true) and call win_unzip with the zips that
were changed.
use the debug module
- name: show contents of download list
debug
var: download_list
to see what has been downloaded
This will work fine until you have a zip file that won't unzip. In which
case you will either have to remove the (broken) zip file and re-run your
playbook, or perhaps change the 'force=no' to 'force=yes'.
Hope this helps.
Jon
On Tuesday, April 4, 2017 at 2:01:19 PM UTC+1, Suporter wrote:
>
> i am downloading zip files from an url, i am using with_items for list of
> zip files in that location, i want to do a task (extract) for only the file
> downloaded. Since i am new to ansible i cant think of anything other than
> using with_items for downloading files, but i dont know how to make use of
> notify here, if i use notify below with_items how it will invoke only the
> file it has downloaded. To summarise , i want to download zip files which
> are changed, extract only the files which are downloaded and install only
> the files which are extracted. Since with_items has all the files listed in
> it , how can i achieve this workflow in ansible
>
>
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/cab4458f-4c91-44ad-914e-d008cfe1764b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.