- Ansible Quick Start Guide
- Mohamed Alibi
- 102字
- 2021-07-23 16:37:47
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:
推薦閱讀
- Introduction to DevOps with Kubernetes
- 智能傳感器技術(shù)與應(yīng)用
- Learning Apache Cassandra(Second Edition)
- AWS Administration Cookbook
- 數(shù)據(jù)庫(kù)系統(tǒng)原理及應(yīng)用教程(第5版)
- Learning Azure Cosmos DB
- 工業(yè)機(jī)器人維護(hù)與保養(yǎng)
- 網(wǎng)絡(luò)服務(wù)搭建、配置與管理大全(Linux版)
- 軟件工程及實(shí)踐
- 從零開(kāi)始學(xué)SQL Server
- 統(tǒng)計(jì)挖掘與機(jī)器學(xué)習(xí):大數(shù)據(jù)預(yù)測(cè)建模和分析技術(shù)(原書(shū)第3版)
- 工業(yè)自動(dòng)化技術(shù)實(shí)訓(xùn)指導(dǎo)
- 啊哈C!思考快你一步
- 基于RPA技術(shù)財(cái)務(wù)機(jī)器人的應(yīng)用與研究
- Hands-On Deep Learning with Go