Browse Source

Refactor package support

Remove dead code. Remove epel-release support and force user to enable
it.

Change-Id: Ie9fc5c43f6aa5eb953923eb4bc2d3d481fc6aa2d
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
changes/07/281507/2
Paul Belanger 6 years ago
parent
commit
d1fcb5b615
  1. 2
      defaults/main.yaml
  2. 11
      tasks/install.yaml
  3. 9
      tasks/install/redhat.yaml
  4. 8
      tests/test.yaml
  5. 14
      vars/Debian.yaml
  6. 1
      vars/RedHat.yaml

2
defaults/main.yaml

@ -20,3 +20,5 @@ nginx_file_include_dir_src: ""
nginx_file_nginx_conf_dest: /etc/nginx/nginx.conf
nginx_file_nginx_conf_src: ""
nginx_package_name: nginx

11
tasks/install.yaml

@ -12,10 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Define nginx_config_include_dir
set_fact:
nginx_config_include_dir: "{{ __nginx_config_include_dir }}"
when: nginx_config_include_dir is not defined
- include: install/redhat.yaml
when: ansible_os_family == 'RedHat'
- name: Install nginx package.
package:
name: "{{ nginx_package_name }}"
state: installed

9
tasks/install/redhat.yaml

@ -12,13 +12,4 @@
# License for the specific language governing permissions and limitations
# under the License.
---
# NOTE(pabelanger): This needs to be here for now, since we need python-pip.
- name: Ensure EPEL is enabled.
yum:
pkg: epel-release
state: installed
- name: Install nginx using yum.
yum:
pkg: nginx
state: installed

8
tests/test.yaml

@ -15,5 +15,13 @@
- hosts: localhost
vars:
rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}"
pre_tasks:
# Make sure OS does not have a stale package cache.
- name: Update apt cache.
become: yes
apt:
update_cache: yes
when: ansible_os_family == 'Debian'
roles:
- "{{ rolename }}"

14
vars/Debian.yaml

@ -0,0 +1,14 @@
# Copyright 2015 Red Hat, 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.
---

1
vars/RedHat.yaml

@ -12,4 +12,3 @@
# License for the specific language governing permissions and limitations
# under the License.
---
__nginx_config_include_dir: /etc/nginx/conf.d

Loading…
Cancel
Save