mirror of
https://github.com/trailofbits/algo.git
synced 2025-04-16 22:27:20 +02:00
fix: Fix server selection in update-user while preserving nice display of server along with its alt_name in the list (#14727)
This commit fixes a bug preventing correct selection of server when trying to update users. It improves the prompt's clarity by providing both server name and IP_subject_alt_name. It also ensures server selection from the list uses actual server names instead of list descriptions strings that caused the initial bug. Co-authored-by: Jack Ivanov <17044561+jackivanov@users.noreply.github.com>
This commit is contained in:
parent
da32bafd2d
commit
346437fa6e
1 changed files with 6 additions and 8 deletions
14
users.yml
14
users.yml
|
@ -25,19 +25,17 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
server_list: >-
|
server_list: >-
|
||||||
[{% for i in _configs_list.files %}
|
[{% for i in _configs_list.files %}
|
||||||
{% set config = lookup('file', i.path)|from_yaml %}
|
{% set config = lookup('file', i.path) | from_yaml %}
|
||||||
'{{ config.server }}'
|
{{ {'server': config.server, 'IP_subject_alt_name': config.IP_subject_alt_name} }}
|
||||||
'{{ config.IP_subject_alt_name }}'
|
|
||||||
{{ ',' if not loop.last else '' }}
|
|
||||||
{% endfor %}]
|
{% endfor %}]
|
||||||
|
|
||||||
- name: Server address prompt
|
- name: Server address prompt
|
||||||
pause:
|
pause:
|
||||||
prompt: |
|
prompt: |
|
||||||
Select the server to update user list below:
|
Select the server to update user list below:
|
||||||
{% for r in server_list %}
|
{% for r in server_list %}
|
||||||
{{ loop.index }}. {{ r }}
|
{{ loop.index }}. {{ r.server }} ({{ r.IP_subject_alt_name }})
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
register: _server
|
register: _server
|
||||||
when: server is undefined
|
when: server is undefined
|
||||||
|
|
||||||
|
@ -46,7 +44,7 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
algo_server: >-
|
algo_server: >-
|
||||||
{% if server is defined %}{{ server }}
|
{% if server is defined %}{{ server }}
|
||||||
{%- elif _server.user_input %}{{ server_list[_server.user_input | int -1 ] }}
|
{%- elif _server.user_input %}{{ server_list[_server.user_input | int -1 ].server }}
|
||||||
{%- else %}omit{% endif %}
|
{%- else %}omit{% endif %}
|
||||||
|
|
||||||
- name: Import host specific variables
|
- name: Import host specific variables
|
||||||
|
|
Loading…
Add table
Reference in a new issue