mirror of
https://github.com/trailofbits/algo.git
synced 2025-08-10 23:03:03 +02:00
Merge branch 'patch-2' of https://github.com/TC1977/algo into TC1977-patch-2
This commit is contained in:
commit
52d9e1092e
1 changed files with 22 additions and 3 deletions
25
users.yml
25
users.yml
|
@ -7,17 +7,36 @@
|
|||
|
||||
tasks:
|
||||
- block:
|
||||
- name: Get list of installed config files
|
||||
find:
|
||||
paths: configs/
|
||||
depth: 2
|
||||
recurse: true
|
||||
hidden: true
|
||||
patterns: ".config.yml"
|
||||
register: _configs_list
|
||||
|
||||
- name: Build string of installed servers
|
||||
set_fact:
|
||||
server_list: "{% if server_list is defined %}{{ server_list }},{% endif %}{{ item.path|replace('configs/','')|replace('/.config.yml','') }}"
|
||||
with_items: "{{ _configs_list.files }}"
|
||||
|
||||
- name: Server address prompt
|
||||
pause:
|
||||
prompt: "Enter the IP address of your server: (or use localhost for local installation)"
|
||||
prompt: |
|
||||
Select the server to update user list below:
|
||||
{% for r in server_list.split(',') %}
|
||||
{{ loop.index }}. {{ r }}
|
||||
{% endfor %}
|
||||
register: _server
|
||||
when: server is undefined
|
||||
when: server is undefined
|
||||
|
||||
- block:
|
||||
- name: Set facts based on the input
|
||||
set_fact:
|
||||
algo_server: >-
|
||||
{% if server is defined %}{{ server }}
|
||||
{%- elif _server.user_input %}{{ _server.user_input }}
|
||||
{%- elif _server.user_input %}{{ server_list.split(',')[_server.user_input | int -1 ] }}
|
||||
{%- else %}omit{% endif %}
|
||||
|
||||
- name: Import host specific variables
|
||||
|
|
Loading…
Add table
Reference in a new issue