-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yml
55 lines (47 loc) · 1.21 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
- name: warning
debug:
msg: 'EPEL is for RedHat Enterprise/CentOS operating systems.'
# The proxy server - proxy server:port number
- name: use a proxy for yum
when: yum_proxy_url is defined and ansible_os_family == 'RedHat'
lineinfile:
dest: /etc/yum.conf
state: present
regexp: '^proxy'
line: "proxy={{ yum_proxy_url }}"
mode: 0644
- name: no proxy for yum
when: yum_proxy_url is undefined and ansible_os_family == 'RedHat'
lineinfile:
dest: /etc/yum.conf
state: absent
regexp: '^proxy'
- name: Detect Travis
when: lookup('env','TRAVIS')
set_fact:
travis: true
- name: Detect if EPEL is OK
when:
- ansible_distribution == 'CentOS'
set_fact:
epel: ok
- name: Install EPEL repository
when: ansible_os_family != 'Ubuntu' and epel is defined
yum:
name: epel-release
state: present
update_cache: true
register: network_access
until: network_access is success
retries: 10
delay: 2
tags:
- server
- name: enable valid base urls
when: yum_proxy_url is defined and ansible_os_family == 'RedHat'
shell: "sed -i 's/#baseurl/baseurl/g' /etc/yum.repos.d/*.repo"
args:
creates: /etc/yum.repos.d/epel.repo
tags:
- skip_ansible_lint