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

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:

主站蜘蛛池模板: 京山县| 方正县| 郸城县| 阿克| 永寿县| 龙陵县| 成都市| 安丘市| 西乡县| 徐闻县| 饶阳县| 永善县| 社会| 九江县| 西城区| 岱山县| 龙江县| 宜宾县| 安达市| 吴川市| 余庆县| 图片| 嵊州市| 双辽市| 平和县| 郯城县| 醴陵市| 岑溪市| 隆子县| 大邑县| 湖南省| 淳化县| 百色市| 高州市| 江永县| 邳州市| 盖州市| 清河县| 泸西县| 博白县| 呼和浩特市|