diff --git a/tasks/install_apt.yml b/tasks/install_apt.yml deleted file mode 100644 index fdc929b..0000000 --- a/tasks/install_apt.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -# 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: Install repo server packages - apt: - pkg: "{{ item }}" - state: "{{ repo_server_package_state }}" - update_cache: yes - cache_valid_time: "{{ cache_timeout }}" - register: install_packages - until: install_packages|success - retries: 5 - delay: 5 - with_items: "{{ repo_server_distro_packages }}" - tags: - - repo-packages diff --git a/tasks/install_yum.yml b/tasks/install_yum.yml deleted file mode 100644 index ee7c288..0000000 --- a/tasks/install_yum.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -# 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: Install repo server packages - yum: - pkg: "{{ 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 diff --git a/tasks/repo_cacher.yml b/tasks/repo_cacher.yml index 2e08b64..c588420 100644 --- a/tasks/repo_cacher.yml +++ b/tasks/repo_cacher.yml @@ -13,25 +13,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Install repo caching server packages (yum) - yum: - pkg: "{{ item }}" - state: "{{ repo_server_package_state }}" - enablerepo: "epel-testing" - register: install_packages - until: install_packages|success - retries: 5 - delay: 5 - with_items: "{{ repo_pkg_cache_server_distro_packages }}" +- name: Enable epel-testing repository for cacher packages + yum_repository: + name: epel-testing + enabled: yes + mirrorlist: 'http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel7&arch=$basearch' + description: 'EPEL Testing Repository' when: - ansible_pkg_mgr == 'yum' - - repo_pkg_cache_enabled | bool tags: - repo_server-install -- name: Install repo caching server packages (apt) - apt: - pkg: "{{ item }}" +- name: Install repo caching server packages + package: + name: "{{ item }}" state: "{{ repo_server_package_state }}" register: install_packages until: install_packages|success @@ -39,7 +34,6 @@ delay: 5 with_items: "{{ repo_pkg_cache_server_distro_packages }}" when: - - ansible_pkg_mgr == 'apt' - repo_pkg_cache_enabled | bool tags: - repo_server-install diff --git a/tasks/repo_install.yml b/tasks/repo_install.yml index 96070d7..42d11b1 100644 --- a/tasks/repo_install.yml +++ b/tasks/repo_install.yml @@ -13,14 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -- include: install_apt.yml - static: no - when: ansible_pkg_mgr == 'apt' - tags: - - repo-apt-packages +- name: Ensure apt cache is up to date + apt: + update_cache: yes + cache_valid_time: "{{ cache_timeout }}" + when: + - ansible_pkg_mgr == 'apt' -- include: install_yum.yml - static: no - 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-yum-packages + - repo-packages