loading...

show http proxy used by ansible

icy1900 profile image Roy Updated on ・1 min read
- 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

Posted on by:

Discussion

pic
Editor guide
 

you cannot use

      - name: show http_proxy                                                                                                                                                                                      
        debug:                                                                                                                                                                                                     
          var: http_proxy 

because the environment variable is not host vars