-
Notifications
You must be signed in to change notification settings - Fork 5
/
local_repo.yaml
33 lines (29 loc) · 1.43 KB
/
local_repo.yaml
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
---
#
# These tasks point a given host at our local package cache
# and prioritise that cache above the main Red Hat or Centos
# package repositories
#
# Requires
# config/rhel.repo.j2
# config/centos.repo.j2
#
- name: write the yum config file to pull from our yum repo cache if installing on RHEL 7
template: src=config/rhel.repo.j2 dest=/etc/yum.repos.d/local.repo
when: (ansible_distribution == "RedHat" and ansible_distribution_major_version == "7")
- name: write the yum config file to pull from our yum repo cache if installing on CentOS 7
template: src=config/centos.repo.j2 dest=/etc/yum.repos.d/local.repo
when: (ansible_distribution == "CentOS" and ansible_distribution_major_version == "7")
- name: Set our Yum Priorities on RHEL 7
command: yum-config-manager \
--setopt="rhel-7-server-cached.priority=1" \
--setopt="rhel-7-server-extras-cached.priority=1" \
--setopt="rhel-7-server-rh-common-cached.priority=1" \
--setopt="rhel-7-server-optional-cached.priority=1"
when: (ansible_distribution == "RedHat" and ansible_distribution_major_version == "7")
- name: Set our Yum Priorities on CentOS 7
command: yum-config-manager \
--setopt="centos-7-base-cached.priority=1" \
--setopt="centos-7-extras-cached.priority=1" \
--setopt="centos-7-updates-cached.priority=1"
when: (ansible_distribution == "CentOS" and ansible_distribution_major_version == "7")