在执行ansible创建用户指定密码的时候,直接passwd=xxxxx 不行,ansible不认明文的密码,我们需要用python进行加密处理
(py3) [root@jumpserver js]# python -c "from passlib.hash import sha512_crypt; import getpass; print(sha512_crypt.using(rounds=5000).hash(getpass.getpass()))"
Password: ##输入指定的密码
$6$U/od1DJn3mbcyGAR$Tk0aqgiVHzRHvi.wTQHUENSL51QV9JxCt6aPCrEqEtbnHYSrfA1OCWlk/1JlJetUKPQfuD1mgD5d7LAE64fW51