Rework service config files

This removes the wonky relative paths used in ansible.

Change-Id: I37cf70c919d3e0a9022b1c63352565c46be07c57
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2016-01-28 10:23:01 -05:00
parent e08a313323
commit 4689704c7f
9 changed files with 72 additions and 21 deletions

View File

@ -64,6 +64,9 @@ zuul_install_method: git
zuul_pip_version:
# tasks/service.yaml
zuul_file_zuul_service_config_group: root
zuul_file_zuul_service_config_owner: root
zuul_file_zuul_merger_service_group: root
zuul_file_zuul_merger_service_owner: root

3
files/etc/default/zuul Normal file
View File

@ -0,0 +1,3 @@
# This file is generated by Ansible
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
#

3
files/etc/sysconfig/zuul Normal file
View File

@ -0,0 +1,3 @@
# This file is generated by Ansible
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
#

View File

View File

@ -12,6 +12,21 @@
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Define zuul_file_zuul_service_config_dest.
set_fact:
zuul_file_zuul_service_config_dest: "{{ __zuul_file_zuul_service_config_dest }}"
when: zuul_file_zuul_service_config_dest is not defined
- name: Define zuul_file_zuul_service_config_mode.
set_fact:
zuul_file_zuul_service_config_mode: "{{ __zuul_file_zuul_service_config_mode }}"
when: zuul_file_zuul_service_config_mode is not defined
- name: Define zuul_file_zuul_service_config_src.
set_fact:
zuul_file_zuul_service_config_src: "{{ __zuul_file_zuul_service_config_src }}"
when: zuul_file_zuul_service_config_src is not defined
- name: Define zuul_file_zuul_merger_service_dest.
set_fact:
zuul_file_zuul_merger_service_dest: "{{ __zuul_file_zuul_merger_service_dest }}"
@ -42,6 +57,14 @@
zuul_file_zuul_server_service_src: "{{ __zuul_file_zuul_server_service_src }}"
when: zuul_file_zuul_server_service_src is not defined
- name: Copy zuul service config into place.
copy:
dest: "{{ zuul_file_zuul_service_config_dest }}"
group: "{{ zuul_file_zuul_service_config_group }}"
mode: "{{ zuul_file_zuul_service_config_mode }}"
owner: "{{ zuul_file_zuul_service_config_owner }}"
src: "{{ zuul_file_zuul_service_config_src }}"
- name: Copy zuul-merger service into place.
copy:
dest: "{{ zuul_file_zuul_merger_service_dest }}"
@ -58,9 +81,6 @@
owner: "{{ zuul_file_zuul_server_service_owner }}"
src: "{{ zuul_file_zuul_server_service_src }}"
- include: service/redhat.yaml
when: ansible_os_family == 'RedHat'
- name: Enable zuul-merger service.
service:
enabled: "{{ zuul_service_zuul_merger_enabled }}"

View File

@ -1,18 +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.
---
- name: Copy sysconfig file into place.
copy:
dest: /etc/sysconfig/zuul
src: ../../files/zuul.sysconfig

View File

@ -95,6 +95,22 @@
- zuul_layout_yaml_stat.stat.pw_name == 'jenkins'
- zuul_layout_yaml_stat.stat.gr_name == 'jenkins'
- name: Register /etc/default/zuul
stat:
path: /etc/default/zuul
register: debian_zuul_service_config_stat
when: ansible_os_family == 'Debian'
- name: Assert debian_zuul_service_config_stat tests.
assert:
that:
- debian_zuul_service_config_stat.stat.exists
- debian_zuul_service_config_stat.stat.isreg
- debian_zuul_service_config_stat.stat.pw_name == 'root'
- debian_zuul_service_config_stat.stat.gr_name == 'root'
- debian_zuul_service_config_stat.stat.mode == '0644'
when: ansible_os_family == 'Debian'
- name: Register /etc/init.d/zuul-merger
stat:
path: /etc/init.d/zuul-merger
@ -127,6 +143,22 @@
- debian_zuul_server_service_stat.stat.mode == '0755'
when: ansible_os_family == 'Debian'
- name: Register /etc/sysconfig/zuul
stat:
path: /etc/sysconfig/zuul
register: redhat_zuul_service_config_stat
when: ansible_os_family == 'RedHat'
- name: Assert redhat_zuul_service_config_stat tests.
assert:
that:
- redhat_zuul_service_config_stat.stat.exists
- redhat_zuul_service_config_stat.stat.isreg
- redhat_zuul_service_config_stat.stat.pw_name == 'root'
- redhat_zuul_service_config_stat.stat.gr_name == 'root'
- redhat_zuul_service_config_stat.stat.mode == '0644'
when: ansible_os_family == 'RedHat'
- name: Register /etc/systemd/system/zuul-merger.service
stat:
path: /etc/systemd/system/zuul-merger.service

View File

@ -17,6 +17,10 @@ __zuul_build_depends:
- python-dev
- python-pip
__zuul_file_zuul_service_config_dest: /etc/default/zuul
__zuul_file_zuul_service_config_mode: "0644"
__zuul_file_zuul_service_config_src: etc/default/zuul
__zuul_file_zuul_merger_service_dest: /etc/init.d/zuul-merger
__zuul_file_zuul_merger_service_mode: "0755"
__zuul_file_zuul_merger_service_src: etc/init.d/zuul-merger

View File

@ -19,6 +19,10 @@ __zuul_build_depends:
- python-devel
- python-pip
__zuul_file_zuul_service_config_dest: /etc/sysconfig/zuul
__zuul_file_zuul_service_config_mode: "0644"
__zuul_file_zuul_service_config_src: etc/sysconfig/zuul
__zuul_file_zuul_merger_service_dest: /etc/systemd/system/zuul-merger.service
__zuul_file_zuul_merger_service_mode: "0644"
__zuul_file_zuul_merger_service_src: etc/systemd/system/zuul-merger.service