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

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:

主站蜘蛛池模板: 内乡县| 长沙市| 杭州市| 霸州市| 九台市| 河北区| 同心县| 彭阳县| 望奎县| 藁城市| 溆浦县| 三明市| 沁水县| 金川县| 宁陵县| 台湾省| 萨嘎县| 方城县| 安国市| 文登市| 聂拉木县| 漳浦县| 天全县| 札达县| 达拉特旗| 甘孜县| 双江| 都昌县| 正阳县| 墨竹工卡县| 岱山县| 丰顺县| 谢通门县| 新营市| 黔南| 梨树县| 绥化市| 阿巴嘎旗| 佳木斯市| 南宁市| 临澧县|