blob: 60873a94b959c774f9466bc54a780a83f372dd66 [file] [log] [blame]
James E. Blaireff5a9d2017-06-20 00:00:37 -07001:title: Tenant Configuration
2
3.. _tenant-config:
4
5Tenant Configuration
6====================
7
8After *zuul.conf* is configured, Zuul component servers will be able
9to start, but a tenant configuration is required in order for Zuul to
10perform any actions. The tenant configuration file specifies upon
11which projects Zuul should operate. These repositories are
12grouped into tenants. The configuration of each tenant is separate
13from the rest (no pipelines, jobs, etc are shared between them).
14
15A project may appear in more than one tenant; this may be useful if
16you wish to use common job definitions across multiple tenants.
17
18The tenant configuration file is specified by the *tenant_config*
19setting in the *scheduler* section of *zuul.yaml*. It is a YAML file
20which, like other Zuul configuration files, is a list of configuration
21objects, though only one type of object is supported, *tenant*.
22
23Tenant
24------
25
26A tenant is a collection of projects which share a Zuul
27configuration. An example tenant definition is::
28
29 - tenant:
30 name: my-tenant
31 source:
32 gerrit:
33 config-projects:
34 - common-config
35 - shared-jobs:
36 include: jobs
37 untrusted-projects:
James E. Blair4b42e362017-07-13 13:52:22 -070038 - zuul-jobs:
39 shadow: common-config
James E. Blaireff5a9d2017-06-20 00:00:37 -070040 - project1
41 - project2
42
43The following attributes are supported:
44
45**name** (required)
46 The name of the tenant. This may appear in URLs, paths, and
47 monitoring fields, and so should be restricted to URL friendly
48 characters (ASCII letters, numbers, hyphen and underscore) and you
49 should avoid changing it unless necessary.
50
51**source** (required)
52 A dictionary of sources to consult for projects. A tenant may
53 contain projects from multiple sources; each of those sources must
54 be listed here, along with the projects it supports. The name of a
55 :ref:`connection<connections>` is used as the dictionary key
56 (e.g. `gerrit` in the example above), and the value is a further
57 dictionary containing the keys below.
58
59 **config-projects**
60 A list of projects to be treated as config projects in this
61 tenant. The jobs in a config project are trusted, which means
62 they run with extra privileges, do not have their configuration
63 dynamically loaded for proposed changes, and zuul.yaml files are
64 only searched for in the master branch.
65
66 **untrusted-projects**
67 A list of projects to be treated as untrusted in this tenant. An
68 untrusted project is the typical project operated on by Zuul.
69 Their jobs run in a more restrictive environment, they may not
70 define pipelines, their configuration dynamically changes in
71 response to proposed changes, Zuul will read configuration files
72 in all of their branches.
73
74 Each of the projects listed may be either a simple string value, or
75 it may be a dictionary with the following keys:
76
77 **include**
78 Normally Zuul will load all of the configuration classes
79 appropriate for the type of project (config or untrusted) in
80 question. However, if you only want to load some items, the
81 *include* attribute can be used to specify that *only* the
82 specified classes should be loaded. Supplied as a string, or a
83 list of strings.
84
85 **exclude**
86 A list of configuration classes that should not be loaded.
87
James E. Blair4b42e362017-07-13 13:52:22 -070088 **shadow**
89 A list of projects which this project is permitted to shadow.
90 Normally, only one project in Zuul may contain definitions for a
91 given job. If a project earlier in the configuration defines a
92 job which a later project redefines, the later definition is
93 considered an error and is not permitted. The "shadow" attribute
94 of a project indicates that job definitions in this project which
95 conflict with the named projects should be ignored, and those in
96 the named project should be used instead. The named projects must
97 still appear earlier in the configuration. In the example above,
98 if a job definition appears in both the "common-config" and
99 "zuul-jobs" projects, the definition in "common-config" will be
100 used.
101
James E. Blaireff5a9d2017-06-20 00:00:37 -0700102 The order of the projects listed in a tenant is important. A job
103 which is defined in one project may not be redefined in another
104 project; therefore, once a job appears in one project, a project
105 listed later will be unable to define a job with that name.
106 Further, some aspects of project configuration (such as the merge
107 mode) may only be set on the first appearance of a project
108 definition.
109
110 Zuul loads the configuration from all *config-projects* in the order
111 listed, followed by all *trusted-projects* in order.