c12s-kubespray/roles/bootstrap-os/tasks/bootstrap-centos.yml
Anton Patsev dfdf530723 Fix work yum in Install packages requirements for bootstrap (#3630)
* Fix Failure talking to yum: Cannot find a valid baseurl for repo: base/7/x86_64 if Install packages in CentOS using proxy

* Add proxy to /etc/yum.conf if http_proxy is defined
2018-11-06 22:44:37 -08:00

37 lines
858 B
YAML

---
- name: Check presence of fastestmirror.conf
stat:
path: /etc/yum/pluginconf.d/fastestmirror.conf
register: fastestmirror
# fastestmirror plugin actually slows down Ansible deployments
- name: Disable fastestmirror plugin
lineinfile:
dest: /etc/yum/pluginconf.d/fastestmirror.conf
regexp: "^enabled=.*"
line: "enabled=0"
state: present
when: fastestmirror.stat.exists
- name: Add proxy to /etc/yum.conf if http_proxy is defined
lineinfile:
path: "/etc/yum.conf"
line: "proxy={{http_proxy}}"
create: yes
state: present
when: http_proxy is defined
- name: Install packages requirements for bootstrap
yum:
name: "{{ packages }}"
state: present
vars:
packages:
- libselinux-python
- epel-release
- name: Install pip for bootstrap
yum:
name: python-pip
state: present