Skip to content

Commit

Permalink
Merge pull request #54 from Chaffelson/move_password_check
Browse files Browse the repository at this point in the history
Move admin_password check
  • Loading branch information
tmgstevens authored Aug 16, 2021
2 parents 5e6e6ac + 142ba1e commit a2737e4
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions roles/cloudera_deploy/tasks/init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,6 @@
ansible.builtin.include_vars:
file: "{{ __user_config_stat.stat.path }}"

# Admin Password
- name: Prompt User for a password if not provided in config or vault
when: admin_password is undefined or admin_password | length < 2
block:
- name: Prompt User for Password if not supplied
no_log: true
pause:
prompt: "No admin password found in profile.yml or extra_vars, or provided password too short; please provide a Password"
register: __user_input_password

- name: Set Admin password
no_log: true
ansible.builtin.set_fact:
admin_password: "{{ __user_input_password.user_input }}"

- name: Assert user has supplied an Admin Password
no_log: true
ansible.builtin.assert:
quiet: yes
that:
- admin_password is defined
- admin_password | length > 2
fail_msg: "You must supply an Admin Password of at least 2 chars"

# Handle Definition File
- name: Seek Definition files in Definition Path
register: __def_file_stat
Expand Down Expand Up @@ -164,6 +140,30 @@
fail_msg: "purge key is present in definition, but not a boolean as expected"
quiet: yes

# Admin Password
- name: Prompt User for a password if not provided in config or vault
when: admin_password is undefined or admin_password | length < 2
block:
- name: Prompt User for Password if not supplied
no_log: true
pause:
prompt: "No admin password found in profile.yml or extra_vars, or provided password too short; please provide a Password"
register: __user_input_password

- name: Set Admin password
no_log: true
ansible.builtin.set_fact:
admin_password: "{{ __user_input_password.user_input }}"

- name: Assert user has supplied an Admin Password
no_log: true
ansible.builtin.assert:
quiet: yes
that:
- admin_password is defined
- admin_password | length > 2
fail_msg: "You must supply an Admin Password of at least 2 chars"

# Merge User Profile to Globals
- name: Marshal User Config into Globals
ansible.builtin.set_fact:
Expand Down

0 comments on commit a2737e4

Please sign in to comment.