这本剧本是否可以为mongodb进行滚动重启? 我还需要一些技巧来重启不同类型的mongo集群,例如 configserver群集重启 复制集集群重新启动 分片重启 MongoS重新启动
---
- name: Mongodb restart
hosts: hosts
become: yes
become_method: sudo
serial: 1
vars:
ansible_ssh_private_key_file: /home/ubuntu/.ssh/id_rsa
tasks:
- name: do restart
sudo: true
service: name=mongodb state=restarted