Added password-cryped to root_password plugin

This commit is contained in:
Alex Hegedus 2017-11-28 21:20:18 -08:00
parent f95f62588b
commit fc569bcac5
2 changed files with 2 additions and 4 deletions

View file

@ -13,6 +13,5 @@ properties:
- required: [password-crypted]
properties:
password: {type: string}
properties:
password-crypted: {type: string}
additionalProperties: false

View file

@ -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'])