使用 ansible 的 user 模块 来设置 root 密码。
大多数 Linux 发行版的密码哈希可以按照以下文档生成 这里
linux_rootpassword__password: 'plz_change_me'
- hosts: classroom vars: - linux_rootpassword__password: "hashvaluehere" roles: - linux_rootpassword
GPLv3
属于 ANTS 框架 的一部分
ansible-galaxy install ANTS-Framework.linux_rootpassword