Treat unparsed inventory as a failure

We don't want to run ansible if we don't get a complete inventory from
our clouds. The reason for this is we cannot be sure that the ordering
of git servers, gerrit, and zuul or our serialized updates of afs
servers will work correctly if we have an incomplete inventory.

Instead we just want ansible to fail and try again in the future (we can
then debug why our clouds are not working).

From the ansible docs for any_unparsed_is_failed:

  If 'true', it is a fatal error when any given inventory source
  cannot be successfully parsed by any available inventory plugin;
  otherwise, this situation only attracts a warning.

Additionally we tell openstack inventory plugin to report failures
rather than empty inventory so that the unparsed failures happen.

Change-Id: I9025776af4316fbdd2c910566883eb3a2530852a
This commit is contained in:
Clark Boylan 2018-09-12 15:06:39 -07:00
parent 9c0e8b8173
commit 681e24d27d
2 changed files with 2 additions and 0 deletions

View File

@ -1,2 +1,3 @@
plugin: openstack plugin: openstack
cache: True cache: True
fail_on_errors: True

View File

@ -17,6 +17,7 @@ enable_plugins=openstack,constructed,yaml,advanced_host_list,ini
cache=True cache=True
cache_plugin=jsonfile cache_plugin=jsonfile
cache_connection=/var/cache/ansible/inventory cache_connection=/var/cache/ansible/inventory
any_unparsed_is_failed=True
[ssh_connection] [ssh_connection]
retries=3 retries=3