You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
algo/roles/cloud-scaleway/tasks/prompts.yml

30 lines
961 B
YAML

---
- pause:
prompt: |
Enter your auth token (https://trailofbits.github.io/algo/cloud-scaleway.html)
echo: false
register: _scaleway_token
when:
- scaleway_token is undefined
- lookup('env','SCW_TOKEN')|length <= 0
- pause:
prompt: |
What region should the server be located in?
{% for r in scaleway_regions %}
{{ loop.index }}. {{ r['alias'] }}
{% endfor %}
Enter the number of your desired region
[{{ scaleway_regions.0.alias }}]
register: _algo_region
when: region is undefined
- name: Set scaleway facts
set_fact:
algo_scaleway_token: "{{ scaleway_token | default(_scaleway_token.user_input) | default(lookup('env','SCW_TOKEN'), true) }}"
algo_region: >-
{% if region is defined %}{{ region }}
{%- elif _algo_region.user_input %}{{ scaleway_regions[_algo_region.user_input | int -1 ]['alias'] }}
{%- else %}{{ scaleway_regions.0.alias }}{% endif %}