ansible_ssh_user fact fix

This commit is contained in:
Jack Ivanov 2019-04-29 10:15:36 +02:00
parent 92948ec45e
commit 9fc1fed8cf

View file

@ -19,6 +19,7 @@
What user should we use to login on the server? (note: passwordless login required, or ignore if you're deploying to localhost) What user should we use to login on the server? (note: passwordless login required, or ignore if you're deploying to localhost)
[root] [root]
register: _algo_ssh_user register: _algo_ssh_user
when: ssh_user is undefined
- name: Set the facts - name: Set the facts
set_fact: set_fact:
@ -26,9 +27,7 @@
{% if ssh_user is defined %}{{ ssh_user }} {% if ssh_user is defined %}{{ ssh_user }}
{%- elif _algo_ssh_user.user_input %}{{ _algo_ssh_user.user_input }} {%- elif _algo_ssh_user.user_input %}{{ _algo_ssh_user.user_input }}
{%- else %}root{% endif %} {%- else %}root{% endif %}
when: when: cloud_instance_ip != "localhost"
- ssh_user is undefined
- cloud_instance_ip != "localhost"
- pause: - pause:
prompt: | prompt: |