Skip to content

Commit a2737e4

Browse files
authored
Merge pull request #54 from Chaffelson/move_password_check
Move admin_password check
2 parents 5e6e6ac + 142ba1e commit a2737e4

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

roles/cloudera_deploy/tasks/init.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -83,30 +83,6 @@
8383
ansible.builtin.include_vars:
8484
file: "{{ __user_config_stat.stat.path }}"
8585

86-
# Admin Password
87-
- name: Prompt User for a password if not provided in config or vault
88-
when: admin_password is undefined or admin_password | length < 2
89-
block:
90-
- name: Prompt User for Password if not supplied
91-
no_log: true
92-
pause:
93-
prompt: "No admin password found in profile.yml or extra_vars, or provided password too short; please provide a Password"
94-
register: __user_input_password
95-
96-
- name: Set Admin password
97-
no_log: true
98-
ansible.builtin.set_fact:
99-
admin_password: "{{ __user_input_password.user_input }}"
100-
101-
- name: Assert user has supplied an Admin Password
102-
no_log: true
103-
ansible.builtin.assert:
104-
quiet: yes
105-
that:
106-
- admin_password is defined
107-
- admin_password | length > 2
108-
fail_msg: "You must supply an Admin Password of at least 2 chars"
109-
11086
# Handle Definition File
11187
- name: Seek Definition files in Definition Path
11288
register: __def_file_stat
@@ -164,6 +140,30 @@
164140
fail_msg: "purge key is present in definition, but not a boolean as expected"
165141
quiet: yes
166142

143+
# Admin Password
144+
- name: Prompt User for a password if not provided in config or vault
145+
when: admin_password is undefined or admin_password | length < 2
146+
block:
147+
- name: Prompt User for Password if not supplied
148+
no_log: true
149+
pause:
150+
prompt: "No admin password found in profile.yml or extra_vars, or provided password too short; please provide a Password"
151+
register: __user_input_password
152+
153+
- name: Set Admin password
154+
no_log: true
155+
ansible.builtin.set_fact:
156+
admin_password: "{{ __user_input_password.user_input }}"
157+
158+
- name: Assert user has supplied an Admin Password
159+
no_log: true
160+
ansible.builtin.assert:
161+
quiet: yes
162+
that:
163+
- admin_password is defined
164+
- admin_password | length > 2
165+
fail_msg: "You must supply an Admin Password of at least 2 chars"
166+
167167
# Merge User Profile to Globals
168168
- name: Marshal User Config into Globals
169169
ansible.builtin.set_fact:

0 commit comments

Comments
 (0)