fix(virtualization): pass a pre-hashed user password through cloud-init unchanged
This commit is contained in:
@@ -14,8 +14,9 @@ users:
|
||||
{% elif _sudo | bool %}
|
||||
sudo: "ALL=(ALL) NOPASSWD:ALL"
|
||||
{% endif %}
|
||||
{% if attrs.password | default('') | length > 0 %}
|
||||
passwd: "{{ attrs.password | password_hash('sha512') }}"
|
||||
{% set _pw = attrs.password | default('') %}
|
||||
{% if _pw | length > 0 %}
|
||||
passwd: "{{ _pw if (_pw | string)[:1] == '$' else _pw | password_hash('sha512') }}"
|
||||
lock_passwd: false
|
||||
{% else %}
|
||||
lock_passwd: true
|
||||
|
||||
Reference in New Issue
Block a user