Reboot when Web-Server feature requires itansible.windows.win_reboot:when:iis_install.reboot_required# One way to ensure the system is reliable, is to set WinRM to a delayed startup-name:Ensure WinRM starts when the system has settled and is ready to work reliablyansible.windows.win_service...
ansible windows -m win_unzip -a"creates=no src=D:\Tomcat8620\webapps\PayChannels-8630.zip dest=D:\Tomcat8620\webapps" 解压到D盘:ansible windows -m win_unzip -a"creates=no src=D:\SupplierPay.zip dest=D:" 重启远程windows主机的服务 ansible windows -m win_service -a "name=Tomcat8630 st...
ansible windows -m win_copy -a "src=/etc/passwd dest=E:filepasswd" 删除文件: ansible windows -m win_file -a "path=E:filepasswd state=absent" 新增用户: ansible windows -m win_user -a "name=stanley password=magedu@123 groups=Administrators" 重启服务: ansible windows -m win_service -a ...
win_rabbitmq_plugin - Manage RabbitMQ plugins win_reboot - Reboot a windows machine win_reg_stat - returns information about a Windows registry key or property of a key win_regedit - Add, change, or remove registry keys and values win_region - Set the region and format settings win_regme...
先说原理ansible可以通过powershell 与winrm远程管理服务实现对windows系统的控制,因为本身ansible就是为了管理linux系统所开发的,建议还是搭配powershell的脚本进行高效管理。 一.windows客户端配置 服务器下载并安装Microsoft .NET Framework 4.5和powershell5.1
when: res.reboot_required3.9、win_scheduled_task — 管理计划的任务name 必填项 字符串 path (必填项) 通往ExecAction的可执行文件的路径 description 任务的描述 triggers 触发条件 # restart_count 任务调度器尝试重新启动任务的次数 # 如果已设置,则还必须设置 `restart_count`,最长允许时间为31天,最短允许时...
# ansible 172.16.10.23 -m win_shell -a 'ipconfig' 4.远程重启windows服务器 # ansible 172.16.10.23 -m win_reboot # ansible 172.16.10.23 -m win_shell -a 'shutdown -r -t 0' 5. 测试创建用户(远程在windows客户端上创建用户) # ansible 172.16.10.23 -m win_user -a "name=testuser1 passwd...
The good news is that, like any other Windows alternatives, there is a dedicated Ansiblewin_rebootmodule to handle this task. Here is what the setting looks like: -name:Reboot a Windows Machine ansible.windows.win_reboot:reboot_timeout:360 ...
3.配置winrm 3.1 下载下面脚本,使用powershell运行,自动配置好winrm https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 (注意:官网教程直到上面结束,但是一般执行完之后检验winrm是否已经运行,因为ansible管控机需要通过端口进行访问winrm) ...
Win32_OperatingSystem).LastBootUpTime win_reboot: attempting to get system boot time <192.168.0.68> ESTABLISH PSRP CONNECTION FOR USER: ictadmin ON PORT 5986 TO 192.168.0.68 <192.168.0.68> ESTABLISH PSRP CONNECTION FOR USER: ictadmin ON PORT 5986 TO 192.168.0.68 win_reboot: attempting to ...