Honor proxy settings during installation, connect epel properly for YUM
This commit is contained in:
parent
d0e4cf5895
commit
b5561d76f2
1 changed files with 36 additions and 19 deletions
|
@ -89,6 +89,36 @@
|
||||||
- inventory_hostname in groups['k8s-cluster']
|
- inventory_hostname in groups['k8s-cluster']
|
||||||
tags: [network, calico, weave, canal, bootstrap-os]
|
tags: [network, calico, weave, canal, bootstrap-os]
|
||||||
|
|
||||||
|
- name: Install epel-release on non-YUM RedHat/CentOS
|
||||||
|
shell: rpm -qa | grep epel-release || rpm -ivh {{ epel_rpm_download_url }}
|
||||||
|
environment:
|
||||||
|
http_proxy: "{{http_proxy|default('')}}"
|
||||||
|
https_proxy: "{{https_proxy|default('')}}"
|
||||||
|
no_proxy: "{{no_proxy|default('')}}"
|
||||||
|
when:
|
||||||
|
- ansible_distribution in ["CentOS","RedHat"]
|
||||||
|
- ansible_pkg_mgr != 'yum'
|
||||||
|
- not is_atomic
|
||||||
|
register: epel_task_result
|
||||||
|
until: epel_task_result|succeeded
|
||||||
|
retries: 4
|
||||||
|
delay: "{{ retry_stagger | random + 3 }}"
|
||||||
|
changed_when: False
|
||||||
|
check_mode: no
|
||||||
|
tags: bootstrap-os
|
||||||
|
|
||||||
|
- block:
|
||||||
|
- name: Install and enable epel-release for YUM
|
||||||
|
yum_repository:
|
||||||
|
name: epel
|
||||||
|
description: YUM EPEL repo
|
||||||
|
baseurl: https://download.fedoraproject.org/pub/epel/$releasever/$basearch/
|
||||||
|
gpgkey: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever
|
||||||
|
enabled: yes
|
||||||
|
- name: yum-clean-metadata
|
||||||
|
command: yum clean metadata
|
||||||
|
args:
|
||||||
|
warn: no
|
||||||
- name: Update package management cache (YUM)
|
- name: Update package management cache (YUM)
|
||||||
yum:
|
yum:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
@ -123,19 +153,6 @@
|
||||||
changed_when: False
|
changed_when: False
|
||||||
tags: bootstrap-os
|
tags: bootstrap-os
|
||||||
|
|
||||||
- name: Install epel-release on RedHat/CentOS
|
|
||||||
shell: rpm -qa | grep epel-release || rpm -ivh {{ epel_rpm_download_url }}
|
|
||||||
when:
|
|
||||||
- ansible_distribution in ["CentOS","RedHat"]
|
|
||||||
- not is_atomic
|
|
||||||
register: epel_task_result
|
|
||||||
until: epel_task_result|succeeded
|
|
||||||
retries: 4
|
|
||||||
delay: "{{ retry_stagger | random + 3 }}"
|
|
||||||
changed_when: False
|
|
||||||
check_mode: no
|
|
||||||
tags: bootstrap-os
|
|
||||||
|
|
||||||
- name: Install packages requirements
|
- name: Install packages requirements
|
||||||
action:
|
action:
|
||||||
module: "{{ ansible_pkg_mgr }}"
|
module: "{{ ansible_pkg_mgr }}"
|
||||||
|
|
Loading…
Reference in a new issue