summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Belanger <pabelanger@redhat.com>2016-02-17 15:08:36 -0500
committerPaul Belanger <pabelanger@redhat.com>2016-02-17 16:54:08 -0500
commitd1fcb5b61590dd26cd97532a89ca2e48229ceaba (patch)
tree3792eb0ed2ef8e382dcc0014aeb649d3e767c17a
parenta1295199445b7f4a490e1d8e73942ca053a0fd6c (diff)
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>
Notes
Notes (review): Code-Review+2: Paul Belanger <pabelanger@redhat.com> Workflow+1: Paul Belanger <pabelanger@redhat.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 18 Feb 2016 14:05:49 +0000 Reviewed-on: https://review.openstack.org/281507 Project: openstack/ansible-role-nginx Branch: refs/heads/master
-rw-r--r--defaults/main.yaml2
-rw-r--r--tasks/install.yaml11
-rw-r--r--tasks/install/redhat.yaml9
-rw-r--r--tests/test.yaml8
-rw-r--r--vars/Debian.yaml14
-rw-r--r--vars/RedHat.yaml1
6 files changed, 28 insertions, 17 deletions
diff --git a/defaults/main.yaml b/defaults/main.yaml
index 3949daf..ca4064b 100644
--- a/defaults/main.yaml
+++ b/defaults/main.yaml
@@ -20,3 +20,5 @@ nginx_file_include_dir_src: ""
20 20
21nginx_file_nginx_conf_dest: /etc/nginx/nginx.conf 21nginx_file_nginx_conf_dest: /etc/nginx/nginx.conf
22nginx_file_nginx_conf_src: "" 22nginx_file_nginx_conf_src: ""
23
24nginx_package_name: nginx
diff --git a/tasks/install.yaml b/tasks/install.yaml
index c72da95..71484ec 100644
--- a/tasks/install.yaml
+++ b/tasks/install.yaml
@@ -12,10 +12,7 @@
12# License for the specific language governing permissions and limitations 12# License for the specific language governing permissions and limitations
13# under the License. 13# under the License.
14--- 14---
15- name: Define nginx_config_include_dir 15- name: Install nginx package.
16 set_fact: 16 package:
17 nginx_config_include_dir: "{{ __nginx_config_include_dir }}" 17 name: "{{ nginx_package_name }}"
18 when: nginx_config_include_dir is not defined 18 state: installed
19
20- include: install/redhat.yaml
21 when: ansible_os_family == 'RedHat'
diff --git a/tasks/install/redhat.yaml b/tasks/install/redhat.yaml
index 7ea7404..7dcd548 100644
--- a/tasks/install/redhat.yaml
+++ b/tasks/install/redhat.yaml
@@ -12,13 +12,4 @@
12# License for the specific language governing permissions and limitations 12# License for the specific language governing permissions and limitations
13# under the License. 13# under the License.
14--- 14---
15# NOTE(pabelanger): This needs to be here for now, since we need python-pip.
16- name: Ensure EPEL is enabled.
17 yum:
18 pkg: epel-release
19 state: installed
20 15
21- name: Install nginx using yum.
22 yum:
23 pkg: nginx
24 state: installed
diff --git a/tests/test.yaml b/tests/test.yaml
index 81dab81..62d6636 100644
--- a/tests/test.yaml
+++ b/tests/test.yaml
@@ -15,5 +15,13 @@
15- hosts: localhost 15- hosts: localhost
16 vars: 16 vars:
17 rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}" 17 rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}"
18 pre_tasks:
19 # Make sure OS does not have a stale package cache.
20 - name: Update apt cache.
21 become: yes
22 apt:
23 update_cache: yes
24 when: ansible_os_family == 'Debian'
25
18 roles: 26 roles:
19 - "{{ rolename }}" 27 - "{{ rolename }}"
diff --git a/vars/Debian.yaml b/vars/Debian.yaml
new file mode 100644
index 0000000..ca41d99
--- /dev/null
+++ b/vars/Debian.yaml
@@ -0,0 +1,14 @@
1# Copyright 2015 Red Hat, Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14---
diff --git a/vars/RedHat.yaml b/vars/RedHat.yaml
index e1ccf05..ca41d99 100644
--- a/vars/RedHat.yaml
+++ b/vars/RedHat.yaml
@@ -12,4 +12,3 @@
12# License for the specific language governing permissions and limitations 12# License for the specific language governing permissions and limitations
13# under the License. 13# under the License.
14--- 14---
15__nginx_config_include_dir: /etc/nginx/conf.d