Ansible批量修改root密码(playbook)

1、vi changpass.yml

  • hosts: lqtapi
    gather_facts: false

    tasks:

    • name: chattr -i
      shell: chattr -i /etc/shadow
    • name: copy ssh key
      shell: echo 'xxxxxxxxx@123455' |passwd --stdin root
    • name: chattr +i
      shell: chattr +i /etc/shadow

2、ansible-playbook changpass.yml

上一篇:LeetCode 141. Linked List Cycle 判断链表是否有环


下一篇:JIT 编译器快速入门