X-Git-Url: https://git.arvados.org/arvados-formula.git/blobdiff_plain/06050e0a5377d3d6a4c54c7f50fe53a06a07c837..0e514df65ddf408108d9e986f85ea584a8916627:/arvados/controller/service/running.sls diff --git a/arvados/controller/service/running.sls b/arvados/controller/service/running.sls index 3fca8f3..edd0476 100644 --- a/arvados/controller/service/running.sls +++ b/arvados/controller/service/running.sls @@ -18,3 +18,21 @@ arvados-controller-service-running-service-running: - sls: {{ sls_config_file }} - require: - pkg: arvados-controller-package-install-pkg-installed + +# Before being able to create resources, we need API to be up. When running the formula for +# the first time, it might be still being configured, so we add this workaround, as suggested at +# https://github.com/saltstack/salt/issues/19084#issuecomment-70317884 +arvados-controller-service-running-service-ready-cmd-run: + cmd.run: + - name: | + while ! (curl -k -s {{ arvados.cluster.Services.Controller.ExternalURL }} | \ + grep -qE "req-[a-z0-9]{20}.{5}error_token") do + echo 'waiting for API to be ready...' + sleep 1 + done + - timeout: 120 + - unless: | + curl -s {{ arvados.cluster.Services.Controller.ExternalURL }} | \ + grep -qE "req-[a-z0-9]{20}.{5}error_token" + - require: + - service: arvados-controller-service-running-service-running