---
# Copyright 2016, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

- name: Ensure apt cache is up to date
  apt:
    update_cache: yes
    cache_valid_time: "{{ cache_timeout }}"
  when:
    - ansible_pkg_mgr == 'apt'

- name: Install repo server packages
  package:
    name: "{{ item }}"
    state: "{{ repo_server_package_state }}"
  register: install_packages
  until: install_packages|success
  retries: 5
  delay: 5
  with_items: "{{ repo_server_distro_packages }}"
  tags:
    - repo-packages

---
# Copyright 2016, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

- name: Ensure apt cache is up to date
  apt:
    update_cache: yes
    cache_valid_time: "{{ cache_timeout }}"
  when:
    - ansible_pkg_mgr == 'apt'

# NOTE: The pip_install role configures the RDO repository to be at a higher
#       priority than EPEL. Packages from RDO will be preferred over EPEL.
- name: Install EPEL repository
  yum:
    name: epel-release
    state: "{{ repo_server_package_state }}"
  when:
    - ansible_pkg_mgr == 'yum'

- name: Install repo server packages
  package:
    name: "{{ item }}"
    state: "{{ repo_server_package_state }}"
  register: install_packages
  until: install_packages|success
  retries: 5
  delay: 5
  with_items: "{{ repo_server_distro_packages }}"
  tags:
    - repo-packages

Install EPEL for repo_server role
Install EPEL for repo_server role

The recent changes to remove EPEL and install RDO broke keystone
since some packages from EPEL are still required. This patch
ensures that the repo_server role can install packages from EPEL if
needed.

Change-Id: I85c46a522a4302542645451b9c8279a8e951fd25
Related-bug: 1670012
