Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix server selection in update-user #14727

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,17 @@
set_fact:
server_list: >-
[{% for i in _configs_list.files %}
{% set config = lookup('file', i.path)|from_yaml %}
'{{ config.server }}'
'{{ config.IP_subject_alt_name }}'
{{ ',' if not loop.last else '' }}
{% set config = lookup('file', i.path) | from_yaml %}
{{ {'server': config.server, 'IP_subject_alt_name': config.IP_subject_alt_name} }}
{% endfor %}]

- name: Server address prompt
pause:
prompt: |
Select the server to update user list below:
Select the server to update user list below:
{% for r in server_list %}
{{ loop.index }}. {{ r }}
{% endfor %}
{{ loop.index }}. {{ r.server }} ({{ r.IP_subject_alt_name }})
{% endfor %}
register: _server
when: server is undefined

Expand All @@ -46,7 +44,7 @@
set_fact:
algo_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 %}

- name: Import host specific variables
Expand Down
Loading