Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify passwords in batches with ansible-playbook

2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report