File tree 1 file changed +14
-3
lines changed
roles/prompt_password/tasks
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 2
2
# - copy_to_become_password: true to automatically set `become_password`
3
3
# as well (if not yet defined).
4
4
---
5
+ - name : SET_FACT | init
6
+ ansible.builtin.set_fact :
7
+ password_prompt :
8
+ tags : always
9
+
5
10
- name : Prompt for ssh password if necessary
6
11
when : ansible_password is undefined
7
12
block :
8
- - name : Conditionally prompt for ssh password
13
+ - name : PAUSE | Conditionally prompt for ssh password
9
14
ansible.builtin.pause :
10
15
prompt : " Password for {{ ansible_user | d('') }}@{{ ansible_host | d('unknown') }}"
11
16
echo : false
12
17
register : password_prompt
13
18
no_log : true
14
19
15
- - name : Set ansible_password
20
+ - name : SET_FACT | Set ansible_password
16
21
ansible.builtin.set_fact :
17
22
ansible_password : " {{ password_prompt.user_input }}"
18
23
no_log : true
19
24
20
- - name : Set ansible_become_password to be the same as ssh password
25
+ - name : SET_FACT | Set ansible_become_password to be the same as ssh password
21
26
ansible.builtin.set_fact :
22
27
ansible_become_password : " {{ ansible_password }}"
23
28
no_log : true
24
29
when : copy_to_become_password | d(false) and ansible_become_password is undefined
30
+
31
+ - name : COMMAND | Test the password for fail-fast
32
+ ansible.builtin.command : ' /usr/bin/true'
33
+ changed_when : false
34
+ become : true
35
+ when : password_prompt.user_input is defined
You can’t perform that action at this time.
0 commit comments