Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ansible/platform] environment variables missing for most fetching tasks #415

Closed
EmptyByte opened this issue Oct 21, 2024 · 1 comment
Closed

Comments

@EmptyByte
Copy link

Many companies have proxies.. For the collection to work and not fail at the third step we need to be able to pass proxy environment variables to the role.

Please add a variable to specify environment variables on tasks such as below with http_proxy and https_proxy vars.

    - name: Import PostgreSQL GPG public key
      become: true
      ansible.builtin.rpm_key:
        key: "https://download.postgresql.org/pub/repos/yum/keys/PGDG-RPM-GPG-KEY-RHEL"
        state: present
      register: download_postgresql_key
      until: download_postgresql_key is success
      retries: 3
      delay: 3

To

    - name: Import PostgreSQL GPG public key
      become: true
      ansible.builtin.rpm_key:
        key: "https://download.postgresql.org/pub/repos/yum/keys/PGDG-RPM-GPG-KEY-RHEL"
        state: present
      environment: "{{ CUSTOMER_ENVIRONMENT_VARS }}"
      register: download_postgresql_key
      until: download_postgresql_key is success
      retries: 3
      delay: 3
@EmptyByte
Copy link
Author

Specifying it at play level worked. Closing.

environment:
    http_proxy: "{{ lookup('env', 'http_proxy') }}"
    https_proxy: "{{ lookup('env', 'https_proxy') }}"
    no_proxy: "{{ lookup('env', 'no_proxy') }}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant