Myluzh Blog

使用Ansible-Playbook批量扩容云主机系统盘

2024-7-18 myluzh Linux

0x00 前言  接到一个需求,有200台云主机系统盘扩容到了80g,/dev/sda已经变成了80g,需要对dev/sda1扩展分区大小。 0x01 编写主机清单 myluzh@myluzhMacBookPro % cat inventory [node] 36.134.92.10 36.212.225.133 36.212.225.129 36.212.225.222 .... # 给node这个组设置账号密码 [node:vars] ansible_ssh_port=22 ansible_ssh_user=root ansible_ssh_pass="k@s8#as0912e" # ansible_python_interpreter=/usr/bin/python3.10 0x02 编写playbook myluzh@myluzhMacBookPro % cat playbook.yml - name: 批量扩容磁盘 hosts: all max_fail_percentage: 0 become: yes tasks: - ...

阅读全文>>

标签: ansible playbook 云主机 磁盘扩容

评论(0) (294)