DEV Community

Roy
Roy

Posted on • Updated on

show http proxy used by ansible

- name: show proxy env
  block:
    - name: show http_proxy
      command: echo $http_proxy

    - name: show proxy ip                                                                                                                                                                                          
      uri:                                                                                                                                                                                                         
        url: http://httpbin.org/ip                                                                                                                                                                                 
      register: content                                                                                                                                                                                            

    - name: show public ip of proxy                                                                                                                                                                                
      debug:                                                                                                                                                                                                       
        var: content.json 

  tags: never

Top comments (1)

Collapse
 
icy1900 profile image
Roy

you cannot use

      - name: show http_proxy                                                                                                                                                                                      
        debug:                                                                                                                                                                                                     
          var: http_proxy 

because the environment variable is not host vars