fix(virtualization): pass a pre-hashed user password through cloud-init unchanged
This commit is contained in:
1 parent
74caca915e
commit
96d2970dc3
1 file changed
+3
-2
@@ -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