[ansible-project] Downloading files with a specific regular expression from remote https host to target server local path.

2020-03-26 Thread Tom K.
Having some difficulty finding what is the Ansible code to do this: Downloading files with a specific regular expression from remote http / https host to a target server local path. So would like to wget http://remote.com/rpm/app*.rpm to a set of target servers. get_url doesn't appear to supp

Re: [ansible-project] Downloading files with a specific regular expression from remote https host to target server local path.

2020-03-26 Thread Dick Visser
It's fundamentally impossible to do what you want, unless the remote server offers some sort of file system equivalent, like a directory index. Dick On Thu, 26 Mar 2020 at 19:24, Tom K. wrote: > > Having some difficulty finding what is the Ansible code to do this: > > Downloading files with a sp

Re: [ansible-project] Downloading files with a specific regular expression from remote https host to target server local path.

2020-03-27 Thread Tom K.
Thanks Dick! I've started to get that impression after searching for quite some time. Currently using a shell command like this to get only specific files down: wget -r -nd --no-parent -A '*pattern*' http://site.com/path/to/file/ Hence why I was thinking it might be possible in Ansible.

Re: [ansible-project] Downloading files with a specific regular expression from remote https host to target server local path.

2020-03-27 Thread Dick Visser
The recursive (-r) option of wget only downloads files that are 'visible'. This works fine for stuff like a web page with indexed directory listings etc. But anything that is not listed won't be magically retrieved. If a site does not contain any links to content that is actually there, wget will n

Re: [ansible-project] Downloading files with a specific regular expression from remote https host to target server local path.

2020-03-27 Thread Tom K.
Let's assume a real site: http://mirror.centos.org/centos/7/os/x86_64/Packages/ wget -r -nd --no-parent -A '*glib*' http: //mirror.centos.org/centos/7/os/x86_64/Packages/ Grabs all the packages that have glib in the name. Now you're also r

Re: [ansible-project] Downloading files with a specific regular expression from remote https host to target server local path.

2020-03-27 Thread oxido A
well may you will need to read the output of curl and then grep over some html tags... I do some like this : curl grep -o -E 'href="([^"*]+)"' | cut -d '"' -f 2 | sort -n | sed -e 's/\///' | tail -1 this wil give you el name of the last file in the list of href="([^"*]+ in my case there are li

Re: [ansible-project] Downloading files with a specific regular expression from remote https host to target server local path.

2020-03-27 Thread Dick Visser
if those files are tailor made for you then I would work with the team providing them to find an alternative way of doing this. What if they created a json file containing all the file information and key that with the host info, after the files are generated? On Fri, 27 Mar 2020 at 20:26, To