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

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:

主站蜘蛛池模板: 文水县| 中方县| 凤山市| 海原县| 沅江市| 息烽县| 凉山| 枞阳县| 祁连县| 喀什市| 屯昌县| 合江县| 北流市| 蕉岭县| 航空| 青神县| 昭平县| 建始县| 武清区| 禹城市| 隆德县| 公主岭市| 阳信县| 尉氏县| 乾安县| 扶风县| 仁化县| 鄱阳县| 永仁县| 南召县| 九江市| 连山| 桑日县| 浮山县| 华容县| 化德县| 舒兰市| 磐安县| 凤翔县| 保德县| 大渡口区|