Initial commit for ansible-role-zuul-registry
Change-Id: Icf7cd02a91372ec7d8a0843f08dbc4c9d45914cc Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
7980519eb1
commit
08c14aab31
56
.zuul.yaml
56
.zuul.yaml
|
@ -1,8 +1,64 @@
|
||||||
---
|
---
|
||||||
|
- job:
|
||||||
|
name: ansible-role-zuul-registry-base
|
||||||
|
pre-run: tests/playbooks/pre.yaml
|
||||||
|
run:
|
||||||
|
- tests/playbooks/run.yaml
|
||||||
|
- tests/playbooks/run-post.yaml
|
||||||
|
post-run: tests/collect-logs.yaml
|
||||||
|
roles:
|
||||||
|
- zuul: windmill/ansible-role-zuul-registry
|
||||||
|
|
||||||
|
# Testing for zuul_registry_install_method: pip
|
||||||
|
- job:
|
||||||
|
name: ansible-role-zuul-registry
|
||||||
|
parent: ansible-role-zuul-registry-base
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: ansible-role-zuul-registry-fedora-latest
|
||||||
|
parent: ansible-role-zuul-registry
|
||||||
|
nodeset: fedora-latest
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: ansible-role-zuul-registry-ubuntu-bionic
|
||||||
|
parent: ansible-role-zuul-registry
|
||||||
|
nodeset: ubuntu-bionic
|
||||||
|
|
||||||
|
# Testing for zuul_registry_install_method: git
|
||||||
|
- job:
|
||||||
|
name: ansible-role-zuul-registry-src
|
||||||
|
parent: ansible-role-zuul-registry-base
|
||||||
|
required-projects:
|
||||||
|
- name: zuul/zuul-registry
|
||||||
|
vars:
|
||||||
|
zuul_registry_git_update: false
|
||||||
|
zuul_registry_install_method: git
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: ansible-role-zuul-registry-src-fedora-latest
|
||||||
|
parent: ansible-role-zuul-registry-src
|
||||||
|
nodeset: fedora-latest
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: ansible-role-zuul-registry-src-ubuntu-bionic
|
||||||
|
parent: ansible-role-zuul-registry-src
|
||||||
|
nodeset: ubuntu-bionic
|
||||||
|
|
||||||
- project:
|
- project:
|
||||||
|
templates:
|
||||||
|
- windmill-jobs-fedora-latest
|
||||||
|
- windmill-jobs-bionic
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
|
- ansible-role-zuul-registry-fedora-latest
|
||||||
|
- ansible-role-zuul-registry-ubuntu-bionic
|
||||||
|
- ansible-role-zuul-registry-src-fedora-latest
|
||||||
|
- ansible-role-zuul-registry-src-ubuntu-bionic
|
||||||
- tox-linters
|
- tox-linters
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
|
- ansible-role-zuul-registry-fedora-latest
|
||||||
|
- ansible-role-zuul-registry-ubuntu-bionic
|
||||||
|
- ansible-role-zuul-registry-src-fedora-latest
|
||||||
|
- ansible-role-zuul-registry-src-ubuntu-bionic
|
||||||
- tox-linters
|
- tox-linters
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
# 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.
|
||||||
|
---
|
||||||
|
# tasks/main.yaml
|
||||||
|
zuul_registry_task_manager:
|
||||||
|
- pre
|
||||||
|
- install
|
||||||
|
- config
|
||||||
|
- service
|
||||||
|
|
||||||
|
# tasks/config.yaml
|
||||||
|
zuul_registry_user_name: zuul-registry
|
||||||
|
zuul_registry_user_group: zuul-registry
|
||||||
|
zuul_registry_user_home: /var/lib/zuul-registry
|
||||||
|
zuul_registry_user_home_mode: 0755
|
||||||
|
# zuul_registry_user_shell:
|
||||||
|
|
||||||
|
zuul_registry_file_registry_yaml_dest: /etc/zuul-registry/registry.yaml
|
||||||
|
zuul_registry_file_registry_yaml_group: "{{ zuul_registry_user_group }}"
|
||||||
|
zuul_registry_file_registry_yaml_mode: 0644
|
||||||
|
zuul_registry_file_registry_yaml_owner: "{{ zuul_registry_user_name }}"
|
||||||
|
zuul_registry_file_registry_yaml_src: etc/zuul-registry/registry.yaml
|
||||||
|
|
||||||
|
# tasks/install.yaml
|
||||||
|
zuul_registry_git_dest: "{{ ansible_user_dir }}/src/opendev.org/zuul/zuul-registry"
|
||||||
|
zuul_registry_git_uri: https://opendev.org/zuul/zuul-registry
|
||||||
|
zuul_registry_git_version: master
|
||||||
|
# zuul_registry_git_refspec:
|
||||||
|
# zuul_registry_git_update:
|
||||||
|
|
||||||
|
zuul_registry_install_method: pip
|
||||||
|
|
||||||
|
zuul_registry_pip_name: zuul-registry
|
||||||
|
# zuul_registry_pip_executable:
|
||||||
|
# zuul_registry_pip_editable:
|
||||||
|
# zuul_registry_pip_extra_args:
|
||||||
|
# zuul_registry_pip_version:
|
||||||
|
# zuul_registry_pip_virtualenv_python:
|
||||||
|
# zuul_registry_pip_virtualenv:
|
||||||
|
# zuul_registry_pip_virtualenv_symlink:
|
||||||
|
|
||||||
|
# tasks/service.yaml
|
||||||
|
zuul_registry_file_zuul_registry_service_manage: true
|
||||||
|
zuul_registry_file_zuul_registry_service_group: root
|
||||||
|
zuul_registry_file_zuul_registry_service_owner: root
|
||||||
|
|
||||||
|
zuul_registry_file_zuul_registry_service_config_manage: true
|
||||||
|
zuul_registry_file_zuul_registry_service_config_group: root
|
||||||
|
zuul_registry_file_zuul_registry_service_config_owner: root
|
||||||
|
|
||||||
|
zuul_registry_service_zuul_registry_daemon_reload: true
|
||||||
|
zuul_registry_service_zuul_registry_enabled: true
|
||||||
|
zuul_registry_service_zuul_registry_manage: true
|
||||||
|
zuul_registry_service_zuul_registry_name: zuul-registry
|
||||||
|
zuul_registry_service_zuul_registry_state: started
|
|
@ -0,0 +1,35 @@
|
||||||
|
# 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.
|
||||||
|
---
|
||||||
|
galaxy_info:
|
||||||
|
author: Paul Belanger
|
||||||
|
description: |
|
||||||
|
Nodepool is a system for launching single-use test nodes on demand based
|
||||||
|
on images built with cached data. It is designed to work with any
|
||||||
|
OpenStack based cloud, and is part of a suite of tools that form a
|
||||||
|
comprehensive test system including Jenkins and Zuul.
|
||||||
|
company: Red Hat, Inc.
|
||||||
|
license: Apache
|
||||||
|
min_ansible_version: 2.4
|
||||||
|
platforms:
|
||||||
|
- name: Fedora
|
||||||
|
versions:
|
||||||
|
- 27
|
||||||
|
- name: Ubuntu
|
||||||
|
versions:
|
||||||
|
- 16.04
|
||||||
|
- 18.04
|
||||||
|
categories:
|
||||||
|
- system
|
||||||
|
dependencies: []
|
|
@ -0,0 +1,33 @@
|
||||||
|
# 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 required directories
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
group: "{{ zuul_registry_user_group }}"
|
||||||
|
owner: "{{ zuul_registry_user_name }}"
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- /etc/zuul-registry
|
||||||
|
|
||||||
|
- name: Install zuul-registry configuration
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
dest: "{{ zuul_registry_file_registry_yaml_dest }}"
|
||||||
|
group: "{{ zuul_registry_file_registry_yaml_group }}"
|
||||||
|
mode: "{{ zuul_registry_file_registry_yaml_mode }}"
|
||||||
|
owner: "{{zuul_registry_file_registry_yaml_owner }}"
|
||||||
|
src: "{{ zuul_registry_file_registry_yaml_src }}"
|
||||||
|
register: zuul_registry_file_registry_yaml
|
|
@ -0,0 +1,35 @@
|
||||||
|
# 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: Define zuul_registry_build_depends
|
||||||
|
set_fact:
|
||||||
|
zuul_registry_build_depends: "{{ __zuul_registry_build_depends | list }}"
|
||||||
|
when: zuul_registry_build_depends is not defined
|
||||||
|
|
||||||
|
- name: Ensure build dependencies are present
|
||||||
|
become: true
|
||||||
|
package:
|
||||||
|
name: "{{ zuul_registry_build_depends }}"
|
||||||
|
state: present
|
||||||
|
when: zuul_registry_install_method == 'git'
|
||||||
|
|
||||||
|
- name: Define zuul_registry_pip_executable if needed
|
||||||
|
set_fact:
|
||||||
|
zuul_registry_pip_executable: pip3
|
||||||
|
when:
|
||||||
|
- zuul_registry_install_method == 'git' or zuul_registry_install_method == 'pip'
|
||||||
|
- zuul_registry_pip_virtualenv_python is not defined
|
||||||
|
- zuul_registry_pip_executable is not defined
|
||||||
|
|
||||||
|
- include: "install/{{ zuul_registry_install_method }}.yaml"
|
|
@ -0,0 +1,27 @@
|
||||||
|
# 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: Git clone zuul-registry
|
||||||
|
git:
|
||||||
|
dest: "{{ zuul_registry_git_dest }}"
|
||||||
|
refspec: "{{ zuul_registry_git_refspec|default(omit) }}"
|
||||||
|
repo: "{{ zuul_registry_git_uri }}"
|
||||||
|
update: "{{ zuul_registry_git_update|default(omit) }}"
|
||||||
|
version: "{{ zuul_registry_git_version|default(omit) }}"
|
||||||
|
|
||||||
|
- name: Set zuul_registry_pip_name to local git repo
|
||||||
|
set_fact:
|
||||||
|
zuul_registry_pip_name: "file://{{ zuul_registry_git_dest }}"
|
||||||
|
|
||||||
|
- include: pip.yaml
|
|
@ -0,0 +1,35 @@
|
||||||
|
# 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: Install zuul-registry using pip
|
||||||
|
become: true
|
||||||
|
pip:
|
||||||
|
executable: "{{ zuul_registry_pip_executable|default(omit) }}"
|
||||||
|
editable: "{{ zuul_registry_pip_editable|default(omit) }}"
|
||||||
|
extra_args: "{{ zuul_registry_pip_extra_args|default(omit) }}"
|
||||||
|
name: "{{ zuul_registry_pip_name }}"
|
||||||
|
version: "{{ zuul_registry_pip_version|default(omit) }}"
|
||||||
|
virtualenv_python: "{{ zuul_registry_pip_virtualenv_python|default(omit) }}"
|
||||||
|
virtualenv: "{{ zuul_registry_pip_virtualenv|default(omit) }}"
|
||||||
|
|
||||||
|
- name: Symlink zuul_registry virtualenv
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
src: "{{ zuul_registry_pip_virtualenv }}"
|
||||||
|
dest: "{{ zuul_registry_pip_virtualenv_symlink }}"
|
||||||
|
state: link
|
||||||
|
when:
|
||||||
|
- zuul_registry_pip_virtualenv is defined
|
||||||
|
- zuul_registry_pip_virtualenv_symlink is defined
|
||||||
|
- zuul_registry_pip_virtualenv != zuul_registry_pip_virtualenv_symlink
|
|
@ -0,0 +1,21 @@
|
||||||
|
# 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: Include OS-specific variables
|
||||||
|
include_vars: "{{ ansible_os_family | lower }}.yaml"
|
||||||
|
|
||||||
|
- include: "{{ zuul_registry_task }}.yaml"
|
||||||
|
with_items: "{{ zuul_registry_task_manager }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: zuul_registry_task
|
|
@ -0,0 +1,33 @@
|
||||||
|
# Copyright 2016 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: true
|
||||||
|
group:
|
||||||
|
name: "{{ zuul_registry_user_group }}"
|
||||||
|
|
||||||
|
- name: Create user account
|
||||||
|
become: true
|
||||||
|
user:
|
||||||
|
createhome: true
|
||||||
|
group: "{{ zuul_registry_user_group }}"
|
||||||
|
home: "{{ zuul_registry_user_home }}"
|
||||||
|
name: "{{ zuul_registry_user_name }}"
|
||||||
|
shell: "{{ zuul_registry_user_shell|default(omit) }}"
|
||||||
|
|
||||||
|
- name: Set permissions on home directory
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: "{{ zuul_registry_user_home }}"
|
||||||
|
mode: "{{ zuul_registry_user_home_mode }}"
|
|
@ -0,0 +1,94 @@
|
||||||
|
# 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: Define zuul_registry_file_zuul_registry_service_dest
|
||||||
|
set_fact:
|
||||||
|
zuul_registry_file_zuul_registry_service_dest: "{{ __zuul_registry_file_zuul_registry_service_dest }}"
|
||||||
|
when: zuul_registry_file_zuul_registry_service_dest is not defined
|
||||||
|
|
||||||
|
- name: Define zuul_registry_file_zuul_registry_service_mode
|
||||||
|
set_fact:
|
||||||
|
zuul_registry_file_zuul_registry_service_mode: "{{ __zuul_registry_file_zuul_registry_service_mode }}"
|
||||||
|
when: zuul_registry_file_zuul_registry_service_mode is not defined
|
||||||
|
|
||||||
|
- name: Define zuul_registry_file_zuul_registry_service_src
|
||||||
|
set_fact:
|
||||||
|
zuul_registry_file_zuul_registry_service_src: "{{ __zuul_registry_file_zuul_registry_service_src }}"
|
||||||
|
when: zuul_registry_file_zuul_registry_service_src is not defined
|
||||||
|
|
||||||
|
- name: Define zuul_registry_file_zuul_registry_service_config_dest
|
||||||
|
set_fact:
|
||||||
|
zuul_registry_file_zuul_registry_service_config_dest: "{{ __zuul_registry_file_zuul_registry_service_config_dest }}"
|
||||||
|
when: zuul_registry_file_zuul_registry_service_config_dest is not defined
|
||||||
|
|
||||||
|
- name: Define zuul_registry_file_zuul_registry_service_config_mode
|
||||||
|
set_fact:
|
||||||
|
zuul_registry_file_zuul_registry_service_config_mode: "{{ __zuul_registry_file_zuul_registry_service_config_mode }}"
|
||||||
|
when: zuul_registry_file_zuul_registry_service_config_mode is not defined
|
||||||
|
|
||||||
|
- name: Define zuul_registry_file_zuul_registry_service_config_src
|
||||||
|
set_fact:
|
||||||
|
zuul_registry_file_zuul_registry_service_config_src: "{{ __zuul_registry_file_zuul_registry_service_config_src }}"
|
||||||
|
when: zuul_registry_file_zuul_registry_service_config_src is not defined
|
||||||
|
|
||||||
|
- name: Install zuul-registry service script into place
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
dest: "{{ zuul_registry_file_zuul_registry_service_dest }}"
|
||||||
|
group: "{{ zuul_registry_file_zuul_registry_service_group }}"
|
||||||
|
mode: "{{ zuul_registry_file_zuul_registry_service_mode }}"
|
||||||
|
owner: "{{ zuul_registry_file_zuul_registry_service_owner }}"
|
||||||
|
src: "{{ zuul_registry_file_zuul_registry_service_src }}"
|
||||||
|
register: zuul_registry_file_zuul_registry_service
|
||||||
|
when: zuul_registry_file_zuul_registry_service_manage
|
||||||
|
|
||||||
|
- name: Create zuul-registry service config directory
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
group: "{{ zuul_registry_file_zuul_registry_service_config_group }}"
|
||||||
|
owner: "{{ zuul_registry_file_zuul_registry_service_config_owner }}"
|
||||||
|
path: "{{ zuul_registry_file_zuul_registry_service_dest }}.d"
|
||||||
|
state: directory
|
||||||
|
when: zuul_registry_file_zuul_registry_service_config_manage
|
||||||
|
|
||||||
|
- name: Install zuul-registry service config into place
|
||||||
|
become: true
|
||||||
|
template:
|
||||||
|
dest: "{{ zuul_registry_file_zuul_registry_service_config_dest }}"
|
||||||
|
group: "{{ zuul_registry_file_zuul_registry_service_config_group }}"
|
||||||
|
mode: "{{ zuul_registry_file_zuul_registry_service_config_mode }}"
|
||||||
|
owner: "{{ zuul_registry_file_zuul_registry_service_config_owner }}"
|
||||||
|
src: "{{ zuul_registry_file_zuul_registry_service_config_src }}"
|
||||||
|
register: zuul_registry_file_zuul_registry_service_config
|
||||||
|
when: zuul_registry_file_zuul_registry_service_config_manage
|
||||||
|
|
||||||
|
- name: Enable zuul-registry service
|
||||||
|
become: true
|
||||||
|
systemd:
|
||||||
|
daemon_reload: "{{ zuul_registry_service_zuul_registry_daemon_reload }}"
|
||||||
|
enabled: "{{ zuul_registry_service_zuul_registry_enabled }}"
|
||||||
|
name: "{{ zuul_registry_service_zuul_registry_name }}"
|
||||||
|
register: zuul_registry_service_zuul_registry
|
||||||
|
when: zuul_registry_service_zuul_registry_manage
|
||||||
|
|
||||||
|
- name: Set zuul-registry service state
|
||||||
|
become: true
|
||||||
|
systemd:
|
||||||
|
daemon_reload: "{{ zuul_registry_service_zuul_registry_daemon_reload }}"
|
||||||
|
name: "{{ zuul_registry_service_zuul_registry_name }}"
|
||||||
|
state: "{{ zuul_registry_service_zuul_registry_state }}"
|
||||||
|
register: zuul_registry_service_zuul_registry_state_info
|
||||||
|
when:
|
||||||
|
- zuul_registry_service_zuul_registry_manage
|
||||||
|
- zuul_registry_service_zuul_registry_state in ['reloaded', 'restarted', 'started', 'stopped']
|
|
@ -0,0 +1,14 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Zuul Registry Service
|
||||||
|
After=syslog.target network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
# Options to pass to zuul-registry.
|
||||||
|
Environment="ARGS=-c /etc/zuul-registry/registry.yaml"
|
||||||
|
Group=zuul-registry
|
||||||
|
User=zuul-registry
|
||||||
|
ExecStart={{ zuul_registry_pip_virtualenv | default('/usr/local') }}/bin/zuul-registry -d $ARGS
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -0,0 +1,3 @@
|
||||||
|
# This file is generated by Ansible
|
||||||
|
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
|
||||||
|
#
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
registry:
|
||||||
|
address: '127.0.0.1'
|
||||||
|
port: 9000
|
||||||
|
storage:
|
||||||
|
driver: filesystem
|
||||||
|
root: /tmp/storage
|
|
@ -0,0 +1,36 @@
|
||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
tasks:
|
||||||
|
- name: Ensure journald logs directory exists
|
||||||
|
file:
|
||||||
|
path: "{{ zuul_output_dir }}/logs/logs/var/log/journal"
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Collect journald logs
|
||||||
|
shell: "sudo journalctl -u {{ item }}.service | tee {{ zuul_output_dir }}/logs/logs/var/log/journal/{{ item }}.service.log"
|
||||||
|
args:
|
||||||
|
creates: "{{ zuul_output_dir }}/logs/logs/var/log/journal/{{ item }}.service.log"
|
||||||
|
with_items:
|
||||||
|
- zuul-registry
|
||||||
|
|
||||||
|
- name: Prepare zuul-registry log files
|
||||||
|
become: true
|
||||||
|
synchronize:
|
||||||
|
dest: "{{ zuul_output_dir }}/logs/logs"
|
||||||
|
rsync_opts:
|
||||||
|
- "--relative"
|
||||||
|
- "--chown={{ ansible_user_id }}:{{ ansible_user_id }}"
|
||||||
|
src: "{{ item }}"
|
||||||
|
verify_host: true
|
||||||
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
|
with_items:
|
||||||
|
- /etc/zuul-registry
|
||||||
|
|
||||||
|
# TODO: Migrate to fetch-zuul-logs when
|
||||||
|
# https://review.opendev.org/#/c/583346/ is merged.
|
||||||
|
- name: Collect log output
|
||||||
|
synchronize:
|
||||||
|
dest: "{{ zuul.executor.log_root }}/"
|
||||||
|
mode: pull
|
||||||
|
src: "{{ zuul_output_dir }}/logs/"
|
||||||
|
verify_host: true
|
|
@ -0,0 +1 @@
|
||||||
|
localhost
|
|
@ -0,0 +1,25 @@
|
||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
tasks:
|
||||||
|
# TODO(pabelanger): Remove once this lands in our base job in
|
||||||
|
# project-config.
|
||||||
|
- name: Execute ensure-output-dirs role
|
||||||
|
include_role:
|
||||||
|
name: ensure-output-dirs
|
||||||
|
|
||||||
|
- name: Disable extra wheels mirror
|
||||||
|
become: true
|
||||||
|
lineinfile:
|
||||||
|
dest: /etc/pip.conf
|
||||||
|
regexp: ^extra-index-url
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Execute bindep role
|
||||||
|
include_role:
|
||||||
|
name: bindep
|
||||||
|
vars:
|
||||||
|
bindep_profile: ansible test
|
||||||
|
|
||||||
|
- name: Execute test-setup role
|
||||||
|
include_role:
|
||||||
|
name: test-setup
|
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
tasks:
|
||||||
|
- name: Run testinfra validation
|
||||||
|
include_role:
|
||||||
|
name: tox
|
||||||
|
vars:
|
||||||
|
tox_envlist: testinfra
|
||||||
|
tox_install_siblings: false
|
|
@ -0,0 +1,42 @@
|
||||||
|
# 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.
|
||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
vars:
|
||||||
|
rolename: ansible-role-zuul-registry
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- "{{ rolename }}"
|
||||||
|
|
||||||
|
post_tasks:
|
||||||
|
- name: Assert results are registered.
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- zuul_registry_file_registry_yaml
|
||||||
|
- zuul_registry_file_zuul_registry_service
|
||||||
|
- zuul_registry_file_zuul_registry_service_config
|
||||||
|
- zuul_registry_service_zuul_registry
|
||||||
|
|
||||||
|
- name: Register zuul_registry_git_dest_stat.
|
||||||
|
stat:
|
||||||
|
path: /home/zuul/src/opendev.org/zuul/zuul-regsitry
|
||||||
|
register: zuul_registry_git_dest_stat
|
||||||
|
when: zuul_registry_install_method == 'git'
|
||||||
|
|
||||||
|
- name: Assert zuul_registry_git_dest tests.
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- zuul_registry_git_dest_stat.stat.exists
|
||||||
|
- zuul_registry_git_dest_stat.stat.isdir
|
||||||
|
when: zuul_registry_install_method == 'git'
|
|
@ -0,0 +1,24 @@
|
||||||
|
# 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.
|
||||||
|
---
|
||||||
|
__zuul_registry_build_depends:
|
||||||
|
- python3-dev
|
||||||
|
|
||||||
|
__zuul_registry_file_zuul_registry_service_dest: /etc/systemd/system/zuul-registry.service
|
||||||
|
__zuul_registry_file_zuul_registry_service_mode: 0644
|
||||||
|
__zuul_registry_file_zuul_registry_service_src: etc/systemd/system/zuul-registry.service
|
||||||
|
|
||||||
|
__zuul_registry_file_zuul_registry_service_config_dest: /etc/systemd/system/zuul-registry.service.d/override.conf
|
||||||
|
__zuul_registry_file_zuul_registry_service_config_mode: 0644
|
||||||
|
__zuul_registry_file_zuul_registry_service_config_src: etc/systemd/system/zuul-registry.service.d/override.conf
|
Loading…
Reference in New Issue