-
-
Save dmsimard/efcaf347daac09c38572755161205037 to your computer and use it in GitHub Desktop.
Spin up an ephemeral ara server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Spins up an ephemeral ara server in the background and provides the URL for . | |
# Requires: | |
# export ANSIBLE_CALLBACK_PLUGINS=$(python3 -m ara.setup.callback_plugins) | |
# export ANSIBLE_LOOKUP_PLUGINS=$(python3 -m ara.setup.lookup_plugins) | |
- name: Spin up a server and sleep | |
hosts: localhost | |
gather_facts: no | |
vars: | |
sleep_duration: 120 | |
tasks: | |
- name: Recover base url from ara | |
set_fact: | |
api_base_url: "{{ lookup('ara_api', '/api/') }}" | |
- name: Print link to ara | |
vars: | |
ui_base_url: "{{ api_base_url.api[0] | regex_replace('/api/v1/', '') }}" | |
debug: | |
msg: "{{ ui_base_url }}" | |
- name: Sleep a number of seconds | |
command: sleep {{ sleep_duration }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment