- - /bin/grep -qE "[a-z0-9]{5}-2x53u-[a-z0-9]{15}" /tmp/{{ vm }}
-
- # There's no direct way to query the scoped_token for a given virtual_machine
- # so we need to parse the api_client_authorization list through some jq
- {%- set cmd_query_scoped_token_url = 'VM_UUID=$(cat /tmp/' ~ vm ~ ') && ' ~
- 'arv api_client_authorization list | ' ~
- '/usr/bin/jq -e \'.items[]| select(.scopes[] == "GET ' ~
- '/arvados/v1/virtual_machines/\'${VM_UUID}\'/logins") | ' ~
- '.api_token\' | head -1 | tee /tmp/sctk' ~ vm ~ ' && ' ~
- 'unset VM_UUID'
- %}
-
-examples-arvados-shell-cron-add-login-sync-add-{{ vm }}-get-scoped_token-cmd-run:
- cmd.run:
- - env:
- - ARVADOS_API_TOKEN: {{ api_token }}
- - ARVADOS_API_HOST: {{ api_host }}
- - name: {{ cmd_query_scoped_token_url }}