Add fingergw support

In zuulv3 we added the fingergw process, update our role to support
that.

Change-Id: I2978bb3c53c2f0ed56a6536be110cb471f157ab2
Depends-On: https://review.openstack.org/551015
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2018-03-07 12:49:06 -05:00
parent b7e1843d5f
commit 3a9c863212
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
12 changed files with 233 additions and 0 deletions

View File

@ -42,6 +42,12 @@ zuul_file_executor_logging_conf_mode: 0644
zuul_file_executor_logging_conf_owner: "{{ zuul_user_name }}"
zuul_file_executor_logging_conf_src: etc/zuul/executor-logging.conf
zuul_file_fingergw_logging_conf_dest: /etc/zuul/fingergw-logging.conf
zuul_file_fingergw_logging_conf_group: "{{ zuul_user_group }}"
zuul_file_fingergw_logging_conf_mode: 0644
zuul_file_fingergw_logging_conf_owner: "{{ zuul_user_name }}"
zuul_file_fingergw_logging_conf_src: etc/zuul/fingergw-logging.conf
zuul_file_merger_logging_conf_dest: /etc/zuul/merger-logging.conf
zuul_file_merger_logging_conf_group: "{{ zuul_user_group }}"
zuul_file_merger_logging_conf_mode: 0644
@ -90,6 +96,14 @@ zuul_file_zuul_executor_service_config_manage: true
zuul_file_zuul_executor_service_config_group: root
zuul_file_zuul_executor_service_config_owner: root
zuul_file_zuul_fingergw_service_manage: true
zuul_file_zuul_fingergw_service_group: root
zuul_file_zuul_fingergw_service_owner: root
zuul_file_zuul_fingergw_service_config_manage: true
zuul_file_zuul_fingergw_service_config_group: root
zuul_file_zuul_fingergw_service_config_owner: root
zuul_file_zuul_merger_service_manage: true
zuul_file_zuul_merger_service_group: root
zuul_file_zuul_merger_service_owner: root
@ -120,6 +134,12 @@ zuul_service_zuul_executor_manage: true
zuul_service_zuul_executor_name: zuul-executor.service
zuul_service_zuul_executor_state: started
zuul_service_zuul_fingergw_daemon_reload: yes
zuul_service_zuul_fingergw_enabled: yes
zuul_service_zuul_fingergw_manage: true
zuul_service_zuul_fingergw_name: zuul-fingergw.service
zuul_service_zuul_fingergw_state: started
zuul_service_zuul_merger_daemon_reload: yes
zuul_service_zuul_merger_enabled: yes
zuul_service_zuul_merger_manage: true

View File

@ -0,0 +1,13 @@
[Unit]
Description=Zuul Finger Gateway Service
After=syslog.target network.target
[Service]
Type=simple
Environment="PREFIX=/usr/local"
Group=root
User=root
ExecStart=/bin/sh -c "${PREFIX}/bin/zuul-fingergw -d"
[Install]
WantedBy=multi-user.target

View File

@ -21,6 +21,15 @@
zuul_service_zuul_executor_state == "started" and not
zuul_service_zuul_executor.changed
- name: Reload zuul-fingergw
become: yes
service:
name: zuul-fingergw
state: reloaded
when: zuul_service_zuul_fingergw_manage and
zuul_service_zuul_fingergw_state == "started" and not
zuul_service_zuul_fingergw.changed
- name: Reload zuul-merger
become: yes
service:

View File

@ -45,6 +45,17 @@
register: zuul_file_executor_logging_conf
notify: Reload zuul-executor
- name: Install fingergw logging file.
become: yes
template:
dest: "{{ zuul_file_fingergw_logging_conf_dest }}"
group: "{{ zuul_file_fingergw_logging_conf_group }}"
mode: "{{ zuul_file_fingergw_logging_conf_mode }}"
owner: "{{ zuul_file_fingergw_logging_conf_owner }}"
src: "{{ zuul_file_fingergw_logging_conf_src }}"
register: zuul_file_fingergw_logging_conf
notify: Reload zuul-fingergw
- name: Install merger logging file.
become: yes
template:
@ -100,5 +111,6 @@
register: zuul_file_zuul_conf
notify:
- Reload zuul-executor
- Reload zuul-fingergw
- Reload zuul-merger
- Reload zuul-scheduler

View File

@ -42,6 +42,36 @@
zuul_file_zuul_executor_service_config_src: "{{ __zuul_file_zuul_executor_service_config_src }}"
when: zuul_file_zuul_executor_service_config_src is not defined
- name: Define zuul_file_zuul_fingergw_service_dest.
set_fact:
zuul_file_zuul_fingergw_service_dest: "{{ __zuul_file_zuul_fingergw_service_dest }}"
when: zuul_file_zuul_fingergw_service_dest is not defined
- name: Define zuul_file_zuul_fingergw_service_mode.
set_fact:
zuul_file_zuul_fingergw_service_mode: "{{ __zuul_file_zuul_fingergw_service_mode }}"
when: zuul_file_zuul_fingergw_service_mode is not defined
- name: Define zuul_file_zuul_fingergw_service_src.
set_fact:
zuul_file_zuul_fingergw_service_src: "{{ __zuul_file_zuul_fingergw_service_src }}"
when: zuul_file_zuul_fingergw_service_src is not defined
- name: Define zuul_file_zuul_fingergw_service_config_dest.
set_fact:
zuul_file_zuul_fingergw_service_config_dest: "{{ __zuul_file_zuul_fingergw_service_config_dest }}"
when: zuul_file_zuul_fingergw_service_config_dest is not defined
- name: Define zuul_file_zuul_fingergw_service_config_mode.
set_fact:
zuul_file_zuul_fingergw_service_config_mode: "{{ __zuul_file_zuul_fingergw_service_config_mode }}"
when: zuul_file_zuul_fingergw_service_config_mode is not defined
- name: Define zuul_file_zuul_fingergw_service_config_src.
set_fact:
zuul_file_zuul_fingergw_service_config_src: "{{ __zuul_file_zuul_fingergw_service_config_src }}"
when: zuul_file_zuul_fingergw_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 }}"
@ -163,6 +193,37 @@
register: zuul_file_zuul_executor_service_config
when: zuul_file_zuul_executor_service_config_manage
- name: Copy zuul-fingergw service into place.
become: yes
copy:
dest: "{{ zuul_file_zuul_fingergw_service_dest }}"
group: "{{ zuul_file_zuul_fingergw_service_group }}"
mode: "{{ zuul_file_zuul_fingergw_service_mode }}"
owner: "{{ zuul_file_zuul_fingergw_service_owner }}"
src: "{{ zuul_file_zuul_fingergw_service_src }}"
register: zuul_file_zuul_fingergw_service
when: zuul_file_zuul_fingergw_service_manage
- name: Create zuul-fingergw service config directory.
become: yes
file:
group: "{{ zuul_file_zuul_fingergw_service_config_group }}"
owner: "{{ zuul_file_zuul_fingergw_service_config_owner }}"
path: "{{ zuul_file_zuul_fingergw_service_dest }}.d"
state: directory
when: zuul_file_zuul_fingergw_service_config_manage
- name: Copy zuul-fingergw service config into place.
become: yes
template:
dest: "{{ zuul_file_zuul_fingergw_service_config_dest }}"
group: "{{ zuul_file_zuul_fingergw_service_config_group }}"
mode: "{{ zuul_file_zuul_fingergw_service_config_mode }}"
owner: "{{ zuul_file_zuul_fingergw_service_config_owner }}"
src: "{{ zuul_file_zuul_fingergw_service_config_src }}"
register: zuul_file_zuul_fingergw_service_config
when: zuul_file_zuul_fingergw_service_config_manage
- name: Copy zuul-merger service into place.
become: yes
copy:
@ -266,6 +327,16 @@
register: zuul_service_zuul_executor
when: zuul_service_zuul_executor_manage
- name: Enable zuul-fingergw service.
become: yes
systemd:
daemon_reload: "{{ zuul_service_zuul_fingergw_daemon_reload }}"
enabled: "{{ zuul_service_zuul_fingergw_enabled }}"
name: "{{ zuul_service_zuul_fingergw_name }}"
state: "{{ zuul_service_zuul_fingergw_state }}"
register: zuul_service_zuul_fingergw
when: zuul_service_zuul_fingergw_manage
- name: Enable zuul-merger service.
become: yes
systemd:

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

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

View File

@ -0,0 +1,44 @@
[loggers]
keys=root,zuul,gear
[handlers]
keys=console,debug,normal
[formatters]
keys=simple
[logger_root]
level=WARNING
handlers=console
[logger_zuul]
level=DEBUG
handlers=debug,normal
qualname=zuul
[logger_gear]
level=WARNING
handlers=debug,normal
qualname=gear
[handler_console]
level=WARNING
class=StreamHandler
formatter=simple
args=(sys.stdout,)
[handler_debug]
level=DEBUG
class=logging.handlers.WatchedFileHandler
formatter=simple
args=('/var/log/zuul/fingergw-debug.log',)
[handler_normal]
level=INFO
class=logging.handlers.WatchedFileHandler
formatter=simple
args=('/var/log/zuul/fingergw.log',)
[formatter_simple]
format=%(asctime)s %(levelname)s %(name)s: %(message)s
datefmt=

View File

@ -27,6 +27,11 @@ finger_port = 17979
log_config = /etc/zuul/executor-logging.conf
workspace_root = /var/lib/zuul/workspace
[fingergw]
listen_address = 127.0.0.1
log_config = /etc/zuul/fingergw-logging.conf
user = {{ zuul_user_name }}
[merger]
git_dir = /var/lib/zuul/git
log_config = /etc/zuul/merger-logging.conf

View File

@ -33,6 +33,7 @@
that:
- zuul_file_gearman_logging_conf
- zuul_file_executor_logging_conf
- zuul_file_fingergw_logging_conf
- zuul_file_merger_logging_conf
- zuul_file_scheduler_logging_conf
- zuul_file_web_logging_conf
@ -40,6 +41,8 @@
- zuul_file_zuul_conf
- zuul_file_zuul_executor_service
- zuul_file_zuul_executor_service_config
- zuul_file_zuul_fingergw_service
- zuul_file_zuul_fingergw_service_config
- zuul_file_zuul_merger_service
- zuul_file_zuul_merger_service_config
- zuul_file_zuul_scheduler_service
@ -47,6 +50,7 @@
- zuul_file_zuul_web_service
- zuul_file_zuul_web_service_config
- zuul_service_zuul_executor
- zuul_service_zuul_fingergw
- zuul_service_zuul_merger
- zuul_service_zuul_scheduler
- zuul_service_zuul_web
@ -145,6 +149,20 @@
- zuul_executor_service_config_stat.stat.gr_name == 'root'
- zuul_executor_service_config_stat.stat.mode == '0644'
- name: Register /etc/systemd/system/zuul-fingergw.service.d/override.conf
stat:
path: /etc/systemd/system/zuul-fingergw.service.d/override.conf
register: zuul_fingergw_service_config_stat
- name: Assert zuul_fingergw_service_config_stat tests.
assert:
that:
- zuul_fingergw_service_config_stat.stat.exists
- zuul_fingergw_service_config_stat.stat.isreg
- zuul_fingergw_service_config_stat.stat.pw_name == 'root'
- zuul_fingergw_service_config_stat.stat.gr_name == 'root'
- zuul_fingergw_service_config_stat.stat.mode == '0644'
- name: Register /etc/systemd/system/zuul-merger.service.d/override.conf
stat:
path: /etc/systemd/system/zuul-merger.service.d/override.conf
@ -201,6 +219,20 @@
- _zuul_executor_service_systemd_stat.stat.gr_name == 'root'
- _zuul_executor_service_systemd_stat.stat.mode == '0644'
- name: Register /etc/systemd/system/zuul-fingergw.service
stat:
path: /etc/systemd/system/zuul-fingergw.service
register: _zuul_fingergw_service_systemd_stat
- name: Assert _zuul_fingergw_service_systemd_stat tests.
assert:
that:
- _zuul_fingergw_service_systemd_stat.stat.exists
- _zuul_fingergw_service_systemd_stat.stat.isreg
- _zuul_fingergw_service_systemd_stat.stat.pw_name == 'root'
- _zuul_fingergw_service_systemd_stat.stat.gr_name == 'root'
- _zuul_fingergw_service_systemd_stat.stat.mode == '0644'
- name: Register /etc/systemd/system/zuul-merger.service
stat:
path: /etc/systemd/system/zuul-merger.service
@ -248,6 +280,11 @@
shell: /usr/sbin/service zuul-executor status
tags: skip_ansible_lint
- name: Ensure zuul-fingergw is running.
become: yes
shell: /usr/sbin/service zuul-fingergw status
tags: skip_ansible_lint
- name: Ensure zuul-merger is running.
become: yes
shell: /usr/sbin/service zuul-merger status

View File

@ -28,6 +28,14 @@ __zuul_file_zuul_executor_service_config_dest: /etc/systemd/system/zuul-executor
__zuul_file_zuul_executor_service_config_mode: 0644
__zuul_file_zuul_executor_service_config_src: etc/systemd/system/zuul-executor.service.d/centos-7.conf
__zuul_file_zuul_fingergw_service_dest: /etc/systemd/system/zuul-fingergw.service
__zuul_file_zuul_fingergw_service_mode: 0644
__zuul_file_zuul_fingergw_service_src: etc/systemd/system/zuul-fingergw.service
__zuul_file_zuul_fingergw_service_config_dest: /etc/systemd/system/zuul-fingergw.service.d/override.conf
__zuul_file_zuul_fingergw_service_config_mode: 0644
__zuul_file_zuul_fingergw_service_config_src: etc/systemd/system/zuul-fingergw.service.d/centos-7.conf
__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

View File

@ -27,6 +27,14 @@ __zuul_file_zuul_executor_service_config_dest: /etc/systemd/system/zuul-executor
__zuul_file_zuul_executor_service_config_mode: 0644
__zuul_file_zuul_executor_service_config_src: etc/systemd/system/zuul-executor.service.d/ubuntu-xenial.conf
__zuul_file_zuul_fingergw_service_dest: /etc/systemd/system/zuul-fingergw.service
__zuul_file_zuul_fingergw_service_mode: 0644
__zuul_file_zuul_fingergw_service_src: etc/systemd/system/zuul-fingergw.service
__zuul_file_zuul_fingergw_service_config_dest: /etc/systemd/system/zuul-fingergw.service.d/override.conf
__zuul_file_zuul_fingergw_service_config_mode: 0644
__zuul_file_zuul_fingergw_service_config_src: etc/systemd/system/zuul-fingergw.service.d/ubuntu-xenial.conf
__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