ansible]# vim user4.yml
---
- hosts: cache
  remote_user: root
  vars:
    user: bb
  tasks:
   - shell: setenforce 0 || true
   - user:
       name: "{{user}}"
       group: root
       password: "{{'123456' | password_hash('sha512')}}"
   - shell: chage -d 0 "{{user}}"
作用:报错不提示
 
ansible]# ansible-playbook user4.yml 
05-13 18:57