ansible-role-zuul/tasks/config.yaml

88 lines
2.3 KiB
YAML

# 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: Create group account.
become: yes
group:
name: "{{ zuul_user_group }}"
- name: Create user account.
become: yes
user:
createhome: yes
home: "{{ zuul_user_home }}"
group: "{{ zuul_user_group }}"
name: "{{ zuul_user_name }}"
- name: Create required directories.
become: yes
file:
group: "{{ zuul_user_group }}"
owner: "{{ zuul_user_name }}"
path: "{{ item }}"
state: directory
with_items:
- /etc/zuul
- /var/log/zuul
- name: Template zuul configuration file.
become: yes
template:
dest: "{{ zuul_template_zuul_conf_dest }}"
src: "{{ zuul_template_zuul_conf_src }}"
notify:
- Reload zuul-merger
- Reload zuul-server
- name: Copy gearman logging file.
become: yes
copy:
dest: "{{ zuul_config_gearman_server_log_config }}"
src: "{{ zuul_file_gearman_logging_conf }}"
notify: Reload zuul-server
- name: Copy merger logging file.
become: yes
copy:
dest: "{{ zuul_config_merger_log_config }}"
src: "{{ zuul_file_merger_logging_conf }}"
notify: Reload zuul-merger
- name: Copy server logging file.
become: yes
copy:
dest: "{{ zuul_config_zuul_log_config }}"
src: "{{ zuul_file_server_logging_conf }}"
notify: Reload zuul-server
- name: Create layout config directory.
become: yes
file:
dest: "{{ zuul_file_layout_dest }}"
group: "{{ zuul_file_layout_group }}"
mode: "{{ zuul_file_layout_mode }}"
owner: "{{ zuul_file_layout_owner }}"
state: directory
- name: Rsync layout configuration.
become: no
synchronize:
delete: yes
dest: "{{ zuul_file_layout_dest }}"
perms: yes
rsync_opts:
- "--chmod=Du=rwx,Dgo=rx"
src: "{{ zuul_file_layout_src }}"
notify: Reload zuul-server