diff options
| author | Mark Goddard <mark@stackhpc.com> | 2020-06-30 11:05:01 +0100 |
|---|---|---|
| committer | Mark Goddard <mark@stackhpc.com> | 2020-07-07 15:00:47 +0000 |
| commit | 56ae2db7ac694d7c651623aa7d2e23b3386bd2b2 (patch) | |
| tree | cf8cbf8a0ab2d1c3d0ad77b4efa6ffe7f019312b /ansible/inventory | |
| parent | 904f1c9bd9aaccdc6d13c50b6b3973e8cc0a8cd3 (diff) | |
| download | kolla-ansible-56ae2db7ac694d7c651623aa7d2e23b3386bd2b2.tar.gz kolla-ansible-56ae2db7ac694d7c651623aa7d2e23b3386bd2b2.zip | |
Performance: Run common role in a separate play
The common role was previously added as a dependency to all other roles.
It would set a fact after running on a host to avoid running twice. This
had the nice effect that deploying any service would automatically pull
in the common services for that host. When using tags, any services with
matching tags would also run the common role. This could be both
surprising and sometimes useful.
When using Ansible at large scale, there is a penalty associated with
executing a task against a large number of hosts, even if it is skipped.
The common role introduces some overhead, just in determining that it
has already run.
This change extracts the common role into a separate play, and removes
the dependency on it from all other roles. New groups have been added
for cron, fluentd, and kolla-toolbox, similar to other services. This
changes the behaviour in the following ways:
* The common role is now run for all hosts at the beginning, rather than
prior to their first enabled service
* Hosts must be in the necessary group for each of the common services
in order to have that service deployed. This is mostly to avoid
deploying on localhost or the deployment host
* If tags are specified for another service e.g. nova, the common role
will *not* automatically run for matching hosts. The common tag must
be specified explicitly
The last of these is probably the largest behaviour change. While it
would be possible to determine which hosts should automatically run the
common role, it would be quite complex, and would introduce some
overhead that would probably negate the benefit of splitting out the
common role.
Partially-Implements: blueprint performance-improvements
Change-Id: I6a4676bf6efeebc61383ec7a406db07c7a868b2a
Diffstat (limited to 'ansible/inventory')
| -rw-r--r-- | ansible/inventory/all-in-one | 22 | ||||
| -rw-r--r-- | ansible/inventory/multinode | 21 |
2 files changed, 43 insertions, 0 deletions
diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one index e0c1fd323..80bf8f783 100644 --- a/ansible/inventory/all-in-one +++ b/ansible/inventory/all-in-one @@ -20,10 +20,19 @@ localhost ansible_connection=local # You can explicitly specify which hosts run each project by updating the # groups in the sections below. Common services are grouped together. + +[common:children] +control +network +compute +storage +monitoring + [chrony-server:children] haproxy [chrony:children] +control network compute storage @@ -250,6 +259,19 @@ control # function appropriately. For example, neutron-metadata-agent must run on the # same host as the l3-agent and (depending on configuration) the dhcp-agent. +# Common +[cron:children] +common + +[fluentd:children] +common + +[kolla-logs:children] +common + +[kolla-toolbox:children] +common + # Elasticsearch Curator [elasticsearch-curator:children] elasticsearch diff --git a/ansible/inventory/multinode b/ansible/inventory/multinode index 3512de4d6..9a4ec0705 100644 --- a/ansible/inventory/multinode +++ b/ansible/inventory/multinode @@ -44,6 +44,14 @@ control # You can explicitly specify which hosts run each project by updating the # groups in the sections below. Common services are grouped together. + +[common:children] +control +network +compute +storage +monitoring + [chrony-server:children] haproxy @@ -269,6 +277,19 @@ control # function appropriately. For example, neutron-metadata-agent must run on the # same host as the l3-agent and (depending on configuration) the dhcp-agent. +# Common +[cron:children] +common + +[fluentd:children] +common + +[kolla-logs:children] +common + +[kolla-toolbox:children] +common + # Elasticsearch Curator [elasticsearch-curator:children] elasticsearch |
