2016-12-07 16:16:06 +00:00
|
|
|
---
|
2018-12-11 10:43:21 +00:00
|
|
|
- name: check if atomic host
|
|
|
|
stat:
|
|
|
|
path: /run/ostree-booted
|
|
|
|
register: ostree
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
is_atomic: "{{ ostree.stat.exists }}"
|
2016-12-07 16:16:06 +00:00
|
|
|
|
|
|
|
- name: Check presence of fastestmirror.conf
|
2017-02-17 21:22:34 +00:00
|
|
|
stat:
|
|
|
|
path: /etc/yum/pluginconf.d/fastestmirror.conf
|
2016-12-07 16:16:06 +00:00
|
|
|
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
|
2017-04-20 16:17:01 +00:00
|
|
|
|
2018-11-07 06:44:37 +00:00
|
|
|
- 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
|
|
|
|
|
2018-12-27 14:30:59 +00:00
|
|
|
- name: Install libselinux-python and yum-utils for bootstrap
|
2017-10-14 08:52:40 +00:00
|
|
|
yum:
|
2018-09-26 07:28:54 +00:00
|
|
|
name: "{{ packages }}"
|
|
|
|
state: present
|
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- libselinux-python
|
2018-12-27 14:30:59 +00:00
|
|
|
- yum-utils
|
2018-12-11 10:43:21 +00:00
|
|
|
when:
|
|
|
|
- not is_atomic
|
2018-09-26 07:28:54 +00:00
|
|
|
|
2018-12-27 14:30:59 +00:00
|
|
|
- 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:
|
2019-01-22 21:44:11 +00:00
|
|
|
- epel_enabled
|
2018-12-27 14:30:59 +00:00
|
|
|
- not is_atomic
|
|
|
|
- package_python_pip.results | length != 0
|
|
|
|
|
2018-09-26 07:28:54 +00:00
|
|
|
- name: Install pip for bootstrap
|
|
|
|
yum:
|
|
|
|
name: python-pip
|
2017-10-14 08:52:40 +00:00
|
|
|
state: present
|
2018-12-11 10:43:21 +00:00
|
|
|
when:
|
|
|
|
- not is_atomic
|
2018-12-27 14:30:59 +00:00
|
|
|
- package_python_pip.results | length != 0
|