kubespray/roles/bootstrap-os/tasks/bootstrap-centos.yml

65 lines
1.4 KiB
YAML

---
- name: check if atomic host
stat:
path: /run/ostree-booted
register: ostree
- set_fact:
is_atomic: "{{ ostree.stat.exists }}"
- 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 libselinux-python and yum-utils for bootstrap
yum:
name: "{{ packages }}"
state: present
vars:
packages:
- libselinux-python
- yum-utils
when:
- not is_atomic
- name: Check python-pip package
yum:
list=python-pip
register: package_python_pip
when:
- not is_atomic
- name: Install epel-release for bootstrap
yum:
name: epel-release
state: present
when:
- not is_atomic
- package_python_pip.results | length != 0
- name: Install pip for bootstrap
yum:
name: python-pip
state: present
when:
- not is_atomic
- package_python_pip.results | length != 0