Expose serial keyword to base-test playbook

Now that zuul supports a single shared ansible_host in inventories,
add the ability for a user to use the serial keyword on our base
playbooks.

When using multi-host inventory files, all of the tasks happen
independent of each other on separate hosts. With a share ansibe_host,
they will end up fighting with each other. One way to avoid this, is
to set the serial keyword to 1, and host will run tasks one at a time.

By default, if base_serial is not set, we'll omit the serial keywork
in the playbooks.

Change-Id: I532939c843e7f6f6a7d29beb84ef523d25536bb3
Depends-On: I674d6baac26852ee1503feb1ed16c279bf773688
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-12-08 10:25:04 -05:00
parent b13521e497
commit 29b7dd1168
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
3 changed files with 14 additions and 0 deletions

View File

@ -2,5 +2,6 @@
# NOTE(pabelanger): We ignore_errors for the following tasks as not to fail
# successful jobs.
ignore_errors: yes
serial: "{{ base_serial | default(omit) }}"
roles:
- remove-build-sshkey

View File

@ -4,6 +4,7 @@
zuul_log_url: "http://logs.openstack.org"
- hosts: all
serial: "{{ base_serial | default(omit) }}"
roles:
- add-build-sshkey
- start-zuul-console

View File

@ -37,6 +37,18 @@
It also sets default timeout and nodeset values (which may be
overidden).
Responds to these variables:
.. zuul:jobvar:: base_serial
:default: Omitted
This sets the serial keyword in the pre and post playbooks
which can be an integer or percentage.
See ansible documentation for more information:
http://docs.ansible.com/ansible/latest/playbooks_delegation.html
pre-run: playbooks/base/pre.yaml
post-run:
- playbooks/base/post-ssh.yaml