title: Using curl in Ansible with environment variable
body: <p>I need to download a deb package, I use:</p>
  
  <pre><code>curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.1.1-amd64.deb
  </code></pre>
  
  <p>I have looked into <a href="http://docs.ansible.com/ansible/uri_module.html" rel="nofollow noreferrer">http://docs.ansible.com/ansible/uri_module.html</a> but unsure how to get this integrated.</p>
  
  <p>Also I set proxy along with this. How can I do so in Ansible?</p>
  
  <p>i am using now</p>
  
  <pre><code>- name: Download the 5.1.1 version of filebeat
    get_url:
        url: https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.1.1-amd64.deb
        dest: /home/ubuntu
    environment:
      http_proxy: http://{{ squid_proxy }}:{{ squid_port }}
      https_proxy: https://{{ squid_proxy }}:{{ squid_port }}
    validate_certs: no
  </code></pre>