Start role refactor

We really haven't updated this role in some time, so update it to use
layout from other roles.

Change-Id: Iff72ea8983c4ff98ef92b50f27e2a910734f237a
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2019-03-30 22:01:21 -04:00
parent 87a3feff6a
commit c5d393b888
6 changed files with 18 additions and 27 deletions

View File

@ -12,6 +12,12 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
--- ---
# tasks/main.yaml
nginx_task_manager:
- install
- config
- service
nginx_file_include_dir_dest: /etc/nginx/conf.d/ nginx_file_include_dir_dest: /etc/nginx/conf.d/
nginx_file_include_dir_group: root nginx_file_include_dir_group: root
nginx_file_include_dir_mode: 0755 nginx_file_include_dir_mode: 0755

View File

@ -12,7 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
--- ---
- name: Copy nginx configuration file. - name: Copy nginx configuration file
become: true
copy: copy:
dest: "{{ nginx_file_nginx_conf_dest }}" dest: "{{ nginx_file_nginx_conf_dest }}"
src: "{{ nginx_file_nginx_conf_src }}" src: "{{ nginx_file_nginx_conf_src }}"
@ -21,7 +22,8 @@
- Validate nginx - Validate nginx
- Restart nginx - Restart nginx
- name: Copy nginx custom configuration. - name: Copy nginx custom configuration
become: true
copy: copy:
dest: "{{ nginx_file_include_dir_dest }}" dest: "{{ nginx_file_include_dir_dest }}"
group: "{{ nginx_file_include_dir_group }}" group: "{{ nginx_file_include_dir_group }}"

View File

@ -13,6 +13,7 @@
# under the License. # under the License.
--- ---
- name: Install nginx from package - name: Install nginx from package
become: true
package: package:
name: "{{ nginx_package_name }}" name: "{{ nginx_package_name }}"
state: present state: present

View File

@ -1,15 +0,0 @@
# 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.
---

View File

@ -12,14 +12,10 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
--- ---
- name: Include OS-specific variables. - name: Include OS-specific variables
include_vars: "{{ ansible_os_family }}.yaml" include_vars: "{{ ansible_os_family }}.yaml"
- include: install.yaml - include: "{{ nginx_task }}.yaml"
become: yes with_items: "{{ nginx_task_manager }}"
loop_control:
- include: config.yaml loop_var: nginx_task
become: yes
- include: service.yaml
become: yes

View File

@ -12,7 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
--- ---
- name: Enable nginx service. - name: Enable nginx service
become: true
service: service:
enabled: yes enabled: yes
name: nginx name: nginx