mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
Added password-cryped to root_password plugin
This commit is contained in:
parent
f95f62588b
commit
fc569bcac5
2 changed files with 2 additions and 4 deletions
|
@ -13,6 +13,5 @@ properties:
|
|||
- required: [password-crypted]
|
||||
properties:
|
||||
password: {type: string}
|
||||
properties:
|
||||
password-crypted: {type: string}
|
||||
additionalProperties: false
|
||||
|
|
|
@ -11,9 +11,8 @@ class SetRootPassword(Task):
|
|||
from bootstrapvz.common.tools import log_check_call
|
||||
password_crypted = info.manifest.plugins['root_password'].get('password-crypted', None)
|
||||
if password_crypted is not None:
|
||||
log_check_call(['chpasswd', '--root', info.root, '--encrypted'],
|
||||
log_check_call(['chroot', info.root, '/usr/sbin/chpasswd', '--encrypted'],
|
||||
'root:' + password_crypted)
|
||||
else:
|
||||
log_check_call(['chroot', info.root, 'chpasswd'],
|
||||
log_check_call(['chroot', info.root, '/usr/sbin/chpasswd'],
|
||||
'root:' + info.manifest.plugins['root_password']['password'])
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue