Add proxy for subscription-manager (#8012) (#8039)

If using proxy, it is necessary to configure it before running
"subscription-manager status" command.
This adds the step.
This commit is contained in:
Kenichi Omichi 2021-09-30 02:20:08 -07:00 committed by GitHub
parent 3b2b618cd2
commit 9fafe9849b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,6 +16,13 @@
become: true become: true
when: not skip_http_proxy_on_os_packages when: not skip_http_proxy_on_os_packages
- name: Add proxy to RHEL subscription-manager if http_proxy is defined
command: /sbin/subscription-manager config --server.proxy_hostname={{ http_proxy | regex_replace(':\\d+$') }} --server.proxy_port={{ http_proxy | regex_replace('^.*:') }}
become: true
when:
- not skip_http_proxy_on_os_packages
- http_proxy is defined
- name: Check RHEL subscription-manager status - name: Check RHEL subscription-manager status
command: /sbin/subscription-manager status command: /sbin/subscription-manager status
register: rh_subscription_status register: rh_subscription_status