官术网_书友最值得收藏!

Ad hoc versus playbook: the win_reboot module

The ad hoc command can be simply executed as shown in the following two examples:

ansible winservers -m win_reboot

ansible win servers -m win_reboot –args="msg='Reboot initiated by remote admin' pre_reboot_delay=5"

The resulting output of either command will look as follows:

This playbook file contains two ways of restarting hosts using the same module:

---
- name: Reboot Windows hosts
hosts: winservers
fast_gathering: false
tasks:
- name: restart Windows hosts with default settings
win_reboot

- name: restart Windows hosts with personalized
settings
win_reboot:
msg: "Reboot initiated by remote admin"
pre_reboot_delay: 5

The resulting playbook output will look as follows:

主站蜘蛛池模板: 洛阳市| 巴南区| 汽车| 修水县| 上饶县| 东平县| 罗山县| 珲春市| 鄂伦春自治旗| 许昌县| 湖口县| 黑龙江省| 松桃| 九寨沟县| 太和县| 阿克| 武鸣县| 原阳县| 屯留县| 建湖县| 阿图什市| 兴宁市| 泾阳县| 建瓯市| 改则县| 赣州市| 南溪县| 灵寿县| 新干县| 遵义县| 昭苏县| 绍兴县| 泌阳县| 武鸣县| 巴林右旗| 蚌埠市| 芦溪县| 岳西县| 台湾省| 舟曲县| 子洲县|