osism / issues

This repository is used for bug reports that are cross-project or not bound to a specific repository (or to an unknown repository).
https://www.osism.tech
1 stars 1 forks source link

Proxy for `ironic-agent.{initramfs,kernel}` download #887

Closed killermoehre closed 7 months ago

killermoehre commented 7 months ago

Hi,

to get into the Internet® at $customer to download the ironic artifacts from opendev.org, we need to use an HTTP proxy. According to ansbile.builtin.get_url, setting the variable https_proxy=http://some_host:port in the Ansible environment should be enough.

But I can't figure out how to set this. I tried different things:

Did I miss something? Should I have set this variable via the host_vars/localhost.yml?

berendt commented 7 months ago

-e is for extra vars. According to https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_environment.html#playbooks-environment we have to use the remove environment.

Something like this:

    - name: Download ironic-agent initramfs
      ansible.builtin.get_url:
        url: "{{ ironic_agent_initramfs_url }}"
        dest: "{{ ironic_agent_files_directory }}/ironic/ironic-agent.initramfs"
        checksum: "{{ ironic_agent_initramfs_checksum }}"
        mode: 0644
      when: enable_ironic_agent_download_images | bool
      environment:
        http_proxy: foo
        https_proxy: foo

    - name: Download ironic-agent kernel
      ansible.builtin.get_url:
        url: "{{ ironic_agent_kernel_url }}"
        dest: "{{ ironic_agent_files_directory }}/ironic/ironic-agent.kernel"
        checksum: "{{ ironic_agent_kernel_checksum }}"
        mode: 0644
      when: enable_ironic_agent_download_images | bool
      environment:
        http_proxy: foo
        https_proxy: foo
berendt commented 7 months ago

@killermoehre Can you test if it works with the modified play in the PR. The proxy_proxies parameter should be part of your environments/configuration.yml file when you are using HTTP proxies.

killermoehre commented 7 months ago

LGTM. I tested it with a custom playbook and the download only, but no error message, it worked as expected.