인터넷에서 일부 응용 프로그램을 다운로드하려면 get_url
모듈과 같은 특정 작업에만 환경 프록시를 설정하고 싶습니다. 다른 모든 작업은 프록시없이 실행해야합니다. 이 작업을 어떻게 수행합니까?특정 작업에만 프록시를 설정하는 방법은 무엇입니까?
0
A
답변
0
당신과 같이, 작업 당 프록시를 설정할 수 있습니다
get_url:
url=http://remote.host.com/file
dest=/tmp/file
http_proxy: http://proxy.example.com:8080
0
당신은 당신의 플레이를위한 환경 변수를 정의하고 get_url
에서 프록시 옵션을 설정할 수 있습니다. documentation에 use_proxy
가입일
---
- hosts: all
environment:
http_proxy: http://127.0.0.1:1234
# You can also set it over https.
https_proxy: http://127.0.0.1:1234
- name: Retrieve some repo
get_url:
url: https://repos.com/cool.repo
dest: /etc/yum.repos.d/cool.repo
use_proxy: yes
하나가 대상 호스트에 환경 변수 정의되어 있어도 아니, 프록시를 사용하지 않는 [use_proxy
로 설정]
경우.
위의 예에서 반대가됩니다.