Ensure we use the package module when installing packages.

Change-Id: Ia5f874eaf3d8ca08ca61a3ee1df3f8416fa83f6f
This commit is contained in:
Donovan Francesco (drifterza) 2017-01-30 10:41:48 +02:00
parent 9d21a73fb2
commit 9c8a51c8d0
4 changed files with 25 additions and 78 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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