forked from pyinfra-dev/pyinfra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add proxy support for files.download() (pyinfra-dev#998)
* Add proxy support for files.download() Proxy support should work with curl and wget Help needed with tests * Fix too long doc line * Add `files.download` proxy tests --------- Co-authored-by: Nick Mills-Barrett <[email protected]>
- Loading branch information
1 parent
8e2c991
commit f0297cd
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"args": ["http://myfile"], | ||
"kwargs": { | ||
"dest": "/home/myfile", | ||
"proxy": "socks5://someproxy" | ||
}, | ||
"facts": { | ||
"server.Date": "datetime:2015-01-01T00:00:00", | ||
"files.File": { | ||
"path=/home/myfile": null | ||
}, | ||
"server.Which": { | ||
"command=curl": "yes" | ||
} | ||
}, | ||
"commands": [ | ||
"curl -sSLf --proxy socks5://someproxy http://myfile -o _tempfile_", | ||
"mv _tempfile_ /home/myfile" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"args": ["http://myfile"], | ||
"kwargs": { | ||
"dest": "/home/myfile", | ||
"proxy": "socks5://someproxy" | ||
}, | ||
"facts": { | ||
"server.Date": "datetime:2015-01-01T00:00:00", | ||
"files.File": { | ||
"path=/home/myfile": null | ||
}, | ||
"server.Which": { | ||
"command=curl": null, | ||
"command=wget": "yes" | ||
} | ||
}, | ||
"commands": [ | ||
"wget -q -e use_proxy=yes -e http_proxy=socks5://someproxy http://myfile -O _tempfile_ || ( rm -f _tempfile_ ; exit 1 )", | ||
"mv _tempfile_ /home/myfile" | ||
] | ||
} |