0

I am trying to download various artefacts for confluent version using get_url module. I am behind a proxy and below is my playbook.

I have to put in a proxy information for one of the downloads, but not for other. Trying to find out how do I determine which ones need proxy details defined in the task and which ones should not have that information. I got verify cert error when I had added proxy information to the second task.

Is there a way to avoid setting that information in the task for the first download task as well

  tasks:
  - name: Download Confluent enterprise version
    get_url:
      url: https://packages.confluent.io/archive/7.0/confluent-7.0.7.tar.gz
      dest:  /export/home/svcuser/tmp
      use_proxy: yes
    register: showconfluentdlstatus
    environment:
      http_proxy: http://myuserid:mypassword@proxy.prudential.com:8080/
      https_proxy: https://myuserid:mypassword@proxy.prudential.com:8080/

  - name: show confluent enterprise download status
    debug: var=showconfluentdlstatus

  - name: uncompress confluent enterprise
    unarchive:
      src: /export/home/svcuser/tmp/confluent-7.0.7.tar.gz
      dest: /export/home/svcuser/tmp/confluent_7.0.7/
    register: unarchiveconfluentstatus

  - name: show unarchive confluent status status
    debug: var=unarchiveconfluentstatus

  - name: Download Confluent playbook for same version as enterprise confluent version
    # Proxy doesn't seem to be needed for this
    get_url:
      url: https://github.com/confluentinc/cp-ansible/archive/refs/heads/7.0.7-post.zip
      dest:  /export/home/svcuser/tmp
    register: showconfluentplaybookdlstatus

  - name: show confluent playbook for same version as enterprise confluent version download status
    debug: var=showconfluentplaybookdlstatus

  - name: uncompress playbook for same version as enterprise confluent version download status
    unarchive:
      src: /export/home/svcuser/tmp/cp-ansible-7.0.7-post.zip
      dest: /export/home/svcuser/tmp/confluent_7.0.7/
    register: unarchiveconfluentplaybookstatus

  - name: show unarchive confluent playbook for same version as enterprise confluent version status
    debug: var=unarchiveconfluentplaybookstatus
adbdkb
  • 1,897
  • 6
  • 37
  • 66

0 Answers0