First, I drop my wish:
- name: copy a package from a private web service to a node stored in paranoid DMZ subnet
copy: src=**https://packages.mycompany.com/**files/awesome-app-1.2.0.tar.gz
dest=/tmp/awesome-app-to-deploy.tar.gz
Due to internal network restrictions, some provisioned nodes cannot fetch setup files (e.g. packages, archives, …) via get_url call (no internet access, paranoid internal firewalls, etc). Since I don’t want to store built/released items into the Ansible VCS repository, I cannot use copy neither.
Searching similar topics I found following resources, but no solution so far:
-
and related Pull Request 634 (get module (with new module-magic-code!)), which aborted (certainly because of introduction of handy get_url module
Since links above are already “old” and inactive for more than 1 year now, I preferred to open this new thread to avoid mixing with existing features (get_url, copy, fetch). First, I’d like to be sure I’m not wrong and that my needs is not satisfied with current Ansible 1.3-dev. Please confirm
As workaround, we can “of course” make things like
-
mount the “LAN repository” (via NFS) to the ansible runner host. But I don’t know any “mount.http” trick…
-
create an “auto-fetch” script that (on demand) pull required files to the ansible runner host. Not sure how I could combine it to be triggered by Ansible execution…
In fact, the solution that I consider the best at the moment would consist to simply extend Ansible copy module so it would support the syntax above, with following implementation design:
- Try to download the src file to ansible runner host in a temporary local location (à la “get_url” but locally)
- Simply use the existing “copy module” source code to transfer the file
Ideally https, http and ftp protocols should be supported, exactly the same get_url does.
My questions are thus following:
- Would such kind of patch accepted?
- If yes, how should we better refactor the existing code of copy and get_url, to keep the code base as DRY as possible?
Since all the bricks are already available, I feel quite interested and ready to try to implement this patch, but feel free to work on it (just leave a note in this thread, so I don’t uselessly sweat on it
Many thanks in advance for your inputs!
Cheers, Gilles