How to modify passwords in batches with ansible-playbook
How to use ansible-playbook to change passwords in batches? This article uses the example code to show, the code is concise and easy to understand, and can be used as a reference for interested friends. I hope it will be helpful to you.
Create a playbook script
Vim change_passwd.yml
-hosts: a Note: ip group configuration in hosts file sudo: yes remote_user: root Note: remote user gather_facts: false tasks:-name: change user passwd user: name= {{item.user}} password= {{item.password | password_hash ('sha512')} update_password=always with_items:-{user:' version' Password:'*'} remarks: modify all users and passwords of the remote server *-{user: 'root', password:' *'} remarks: multiple users continue to add
Execute command: ansible-playbook change_passwd.ym
On the use of ansible-playbook batch password modification method to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you like this article, you might as well share it for more people to see.