mirror of
https://github.com/trailofbits/algo.git
synced 2025-08-13 16:23:00 +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
23
users.yml
23
users.yml
|
@ -7,17 +7,36 @@
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- block:
|
- 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
|
- name: Server address prompt
|
||||||
pause:
|
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
|
register: _server
|
||||||
when: server is undefined
|
when: server is undefined
|
||||||
|
|
||||||
|
- block:
|
||||||
- name: Set facts based on the input
|
- name: Set facts based on the input
|
||||||
set_fact:
|
set_fact:
|
||||||
algo_server: >-
|
algo_server: >-
|
||||||
{% if server is defined %}{{ 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 %}
|
{%- else %}omit{% endif %}
|
||||||
|
|
||||||
- name: Import host specific variables
|
- name: Import host specific variables
|
||||||
|
|
Loading…
Add table
Reference in a new issue