-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.yml
39 lines (34 loc) · 1.15 KB
/
test.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
---
- name: Setup new RHEL 7 server
hosts: servers
become: true
tasks:
- name: Add EPEL - Check if already present
stat: path="/etc/yum.repos.d/epel.repo"
register: epel_repofile_result
- name: Add EPEL - Install EPEL
yum:
name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm"
state: present
register: result
when: not epel_repofile_result.stat.exists
- name: Add EPEL - Import EPEL's GPG Key
rpm_key:
key: "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}"
state: present
when: not epel_repofile_result.stat.exists
- name: Enable the Red Hat extras repo
rhsm_repository:
name: rhel-7-server-extras-rpms
state: enabled
- name: Enable the Red Hat optional repo
rhsm_repository:
name: rhel-7-server-optional-rpms
- name: Install other required packages
yum: name={item} state=present
with_items:
- vim_enhanced
- rsync
- wget
- ovirt-guest-agent
- ipa-client