ara_api role: allow retries when attempting to run sql migrations

We've seen sql migrations unexplicably fail in integration tests against
mysql and postgresql only to succeed if ran manually later.

It doesn't hurt to re-try migrations if the command hasn't succeeded the
first time around so implement a retry to see if this improves the
success rate.

Change-Id: Id10bfb9a643bbb3ec1907580826104ded30db2a6
This commit is contained in:
David Moreau Simard 2020-01-22 11:52:48 -05:00
parent 872acf31d6
commit e113e869e0
2 changed files with 8 additions and 0 deletions

View File

@ -48,3 +48,7 @@
PATH: "{{ path_with_virtualenv | default('/usr/bin:/usr/local/bin') }}"
command: ara-manage migrate
run_once: true
register: _ara_sql_migrations
retries: 3
delay: 5
until: _ara_sql_migrations is succeeded

View File

@ -48,3 +48,7 @@
PATH: "{{ path_with_virtualenv | default('/usr/bin:/usr/local/bin') }}"
command: ara-manage migrate
run_once: true
register: _ara_sql_migrations
retries: 3
delay: 5
until: _ara_sql_migrations is succeeded