2016-12-08 00:16:06 +08:00
|
|
|
---
|
2018-12-11 18:43:21 +08:00
|
|
|
- name: check if atomic host
|
|
|
|
stat:
|
|
|
|
path: /run/ostree-booted
|
|
|
|
register: ostree
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
is_atomic: "{{ ostree.stat.exists }}"
|
2016-12-08 00:16:06 +08:00
|
|
|
|
|
|
|
- name: Check presence of fastestmirror.conf
|
2017-02-18 05:22:34 +08:00
|
|
|
stat:
|
|
|
|
path: /etc/yum/pluginconf.d/fastestmirror.conf
|
2016-12-08 00:16:06 +08: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-21 00:17:01 +08:00
|
|
|
|
2018-11-07 14:44:37 +08: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
|
|
|
|
|
2017-04-21 00:17:01 +08:00
|
|
|
- name: Install packages requirements for bootstrap
|
2017-10-14 16:52:40 +08:00
|
|
|
yum:
|
2018-09-26 15:28:54 +08:00
|
|
|
name: "{{ packages }}"
|
|
|
|
state: present
|
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- libselinux-python
|
|
|
|
- epel-release
|
2018-12-11 18:43:21 +08:00
|
|
|
when:
|
|
|
|
- not is_atomic
|
2018-09-26 15:28:54 +08:00
|
|
|
|
|
|
|
- name: Install pip for bootstrap
|
|
|
|
yum:
|
|
|
|
name: python-pip
|
2017-10-14 16:52:40 +08:00
|
|
|
state: present
|
2018-12-11 18:43:21 +08:00
|
|
|
when:
|
|
|
|
- not is_atomic
|