Skip to content

Instantly share code, notes, and snippets.

@dmsimard
Created January 13, 2024 03:50
Show Gist options
  • Save dmsimard/efcaf347daac09c38572755161205037 to your computer and use it in GitHub Desktop.
Save dmsimard/efcaf347daac09c38572755161205037 to your computer and use it in GitHub Desktop.
Spin up an ephemeral ara server
# 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