1.创建用户并修改密码
密码需要sha512机密
[root@monitor01 ansible]# cat edit_passwd.yml
- hosts: monitor
remote_user: root
vars:
- name1: test
- chpass: 1a2b
tasks:
- name: change pasword
user: name={{ name1 }} password={{ chpass | password_hash('sha512') }} update_password=always
网友评论